:root {
    /* Light theme */
    --bg-primary: #FDFBF8;
    --bg-card: #FFFFFF;
    --text-primary: #383838;
    --text-secondary: #6B7280;
    --border-color: #F0EBE5;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.07);
}

[data-theme="dark"] {
    /* Dark theme */
    --bg-primary: #111827;
    --bg-card: #1F2937;
    --text-primary: #FFFFFF;
    --text-secondary: #E5E7EB;
    --border-color: #374151;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* Beautiful background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(34, 197, 94, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

[data-theme="dark"] body::before {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(34, 197, 94, 0.08) 0%, transparent 50%);
}

.card {
    background-color: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 
        0 4px 6px -1px var(--shadow-light), 
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 20px 25px -5px var(--shadow-medium), 
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Card animations */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px 0 rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

.result-value {
    font-weight: 600;
    color: #2c5282;
}

.result-value.negative {
    color: #c53030;
}

.result-value.positive {
    color: #2f855a;
}

/* Input and Slider Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    cursor: pointer;
    outline: none;
    border-radius: 15px;
    height: 6px;
    background: #e5e7eb; /* gray-200 */
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    background-color: #3B82F6; /* blue-500 */
    border-radius: 50%;
    border: none;
    transition: background-color 0.2s ease-in-out;
}

input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    background-color: #3B82F6;
    border-radius: 50%;
    border: none;
    transition: background-color 0.2s ease-in-out;
}

/* Dark mode toggle styles */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
    transition: fill 0.3s ease;
}

@media (max-width: 640px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
        top: 15px;
        right: 15px;
    }
    
    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* Card title styling for index page */
.card h2 {
    font-size: 1.4rem;
}

/* Dark mode text overrides */
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .bg-gray-50 {
    background-color: #374151 !important;
}

[data-theme="dark"] .bg-gray-200 {
    background-color: #4B5563 !important;
}

[data-theme="dark"] .text-gray-900 {
    color: #FFFFFF !important;
}

/* Fix green background in dark mode for SL section */
[data-theme="dark"] .bg-green-50 {
    background-color: rgb(14, 26, 18) !important;
}

[data-theme="dark"] .text-green-700 {
    color: rgb(32, 185, 89) !important;
}

/* Dark mode for blue sections */
[data-theme="dark"] .bg-blue-50 {
    background-color: #1e3a8a !important;
}

[data-theme="dark"] .text-blue-800 {
    color: #93c5fd !important;
}

[data-theme="dark"] .border-blue-200 {
    border-color: #3b82f6 !important;
}

/* Better input styling */
.space-y-2 > * + * {
    margin-top: 0.5rem;
}

input[type="number"],
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] input[type="number"],
[data-theme="dark"] select {
    background: rgba(55, 65, 81, 0.9) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

input[type="number"]:focus,
select:focus {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.15),
        0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

/* Salary cards enhanced styling */
.bg-green-50 {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.9) 0%, rgba(220, 252, 231, 0.9) 100%) !important;
    backdrop-filter: blur(10px);
}

.bg-blue-50 {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, rgba(219, 234, 254, 0.9) 100%) !important;
    backdrop-filter: blur(10px);
}

/* Dark mode salary cards */
[data-theme="dark"] .bg-green-50 {
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.3) 0%, rgba(4, 120, 87, 0.2) 100%) !important;
}

[data-theme="dark"] .bg-blue-50 {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.3) 0%, rgba(37, 99, 235, 0.2) 100%) !important;
}

/* Animated salary values */
.result-value, 
#salarioMensual12, 
#salarioPorPaga {
    transition: all 0.3s ease;
    display: inline-block;
}

.result-value:hover,
#salarioMensual12:hover,
#salarioPorPaga:hover {
    transform: scale(1.05);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode focus states */
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] select:focus {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.3),
        0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(75, 85, 99, 0.95) !important;
    border-color: #3B82F6 !important;
}

/* Dark mode color overrides for better contrast */
[data-theme="dark"] .bg-red-50 {
    background-color: rgba(127, 29, 29, 0.3) !important;
}

[data-theme="dark"] .text-red-700,
[data-theme="dark"] .text-red-600 {
    color: #fca5a5 !important;
}

[data-theme="dark"] .border-red-200 {
    border-color: #dc2626 !important;
}

[data-theme="dark"] .bg-orange-50 {
    background-color: rgba(154, 52, 18, 0.3) !important;
}

[data-theme="dark"] .text-orange-700,
[data-theme="dark"] .text-orange-600 {
    color: #fdba74 !important;
}

[data-theme="dark"] .border-orange-200 {
    border-color: #ea580c !important;
}

[data-theme="dark"] .bg-purple-50 {
    background-color: rgba(88, 28, 135, 0.3) !important;
}

[data-theme="dark"] .text-purple-700,
[data-theme="dark"] .text-purple-600 {
    color: #c4b5fd !important;
}

[data-theme="dark"] .border-purple-200 {
    border-color: #7c3aed !important;
}

[data-theme="dark"] .bg-yellow-50 {
    background-color: rgba(146, 64, 14, 0.3) !important;
}

[data-theme="dark"] .text-yellow-700,
[data-theme="dark"] .text-yellow-600 {
    color: #fcd34d !important;
}

[data-theme="dark"] .border-yellow-200 {
    border-color: #d97706 !important;
}

[data-theme="dark"] .text-blue-600,
[data-theme="dark"] .text-blue-700,
[data-theme="dark"] .text-blue-800 {
    color: #93c5fd !important;
}

[data-theme="dark"] .text-green-600,
[data-theme="dark"] .text-green-700,
[data-theme="dark"] .text-green-800 {
    color: #86efac !important;
}




/* Tooltip styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    white-space: normal;
    line-height: 1.4;
}

[data-theme="dark"] .tooltip:hover::after {
    background-color: #374151;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

[data-theme="dark"] .tooltip:hover::before {
    border-top-color: #374151;
}

.tooltip-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.6;
    transition: all 0.3s ease;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

.tooltip:hover .tooltip-icon {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
}

/* Loading and animation effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(even) {
    animation-delay: 0.1s;
}

.card:nth-child(odd) {
    animation-delay: 0.2s;
}

/* Results highlighting animation */
.result-highlight {
    animation: pulse 0.6s ease-in-out;
}

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

/* Enhanced theme toggle */
.theme-toggle {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle {
    background-color: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.2);
}
