/* Card styling */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .glass-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(55, 65, 81, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Input labels */
.input-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.dark .input-label {
    color: #d1d5db;
}

/* Input fields */
.input-field {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(209, 213, 219, 0.8);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: #1f2937;
}

.input-field-sm {
    width: 5rem;
    text-align: center;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.input-field:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.dark .input-field {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.6);
    color: #f3f4f6;
}

.dark .input-field:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

/* Slider group */
.slider-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Range slider */
.range-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(209, 213, 219, 0.6);
    outline: none;
    cursor: pointer;
}

.dark .range-slider {
    background: rgba(75, 85, 99, 0.6);
}

.range-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    box-shadow: 0 2px 6px rgba(20, 184, 166, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(20, 184, 166, 0.5);
}

.range-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    box-shadow: 0 2px 6px rgba(20, 184, 166, 0.4);
    cursor: pointer;
    border: none;
}

/* Tooltips */
.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    border-radius: 50%;
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
    cursor: help;
    font-style: normal;
    line-height: 1;
}

.dark .tooltip-trigger {
    background: rgba(45, 212, 191, 0.15);
    color: #5eead4;
}

.tooltip-popup {
    position: fixed;
    max-width: 240px;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    color: #f3f4f6;
    background: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: normal;
}

.tooltip-popup.visible {
    opacity: 1;
}

/* Input with prefix ($) */
.input-with-prefix {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 2;
}

.dark .input-prefix {
    color: #9ca3af;
}

.input-has-prefix {
    padding-left: 1.75rem;
}

/* Remove number input spinners/arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Select styling */
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* FIRE type cards */
.fire-card {
    transition: box-shadow 0.2s ease;
}

.fire-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dark .fire-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Gradient borders */
.gradient-border {
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.dark .gradient-border {
    border: 1px solid rgba(20, 184, 166, 0.2);
}

/* Loading state - simple opacity transition */
.calculating {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Status badges */
.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.dark .badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.dark .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.dark .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Chart containers */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-height: 320px;
    width: 100% !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.5);
}

/* Smooth transitions for theme toggle */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0ms;
}

body, .glass-card, .input-field, nav, footer {
    transition-duration: 300ms;
}

/* Pulse animation for the status dot */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mobile improvements */
@media (max-width: 768px) {
    .chart-container canvas {
        max-height: 260px;
    }

    .slider-group {
        flex-wrap: wrap;
    }

    .slider-group .range-slider {
        width: 100%;
        order: 2;
    }

    .slider-group .input-field-sm {
        order: 1;
        width: 100%;
        text-align: left;
    }
}

/* Print styles */
@media print {
    nav, footer, button, .gradient-border::before {
        display: none !important;
    }
    .glass-card {
        background: white !important;
        border: 1px solid #e5e7eb !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
}
