/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #05386B;
    --secondary-color: #379683;
    --accent-color: #5CDB95;
    --light-accent: #8EE4AF;
    --background-color: #EDF5E1;
    
    /* Holographic colors */
    --holo-pink: #ff6b9d;
    --holo-blue: #4ecdc4;
    --holo-purple: #a8e6cf;
    --holo-gradient: linear-gradient(45deg, var(--holo-pink), var(--holo-blue), var(--accent-color));
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-bold: 700;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border radius */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(5, 56, 107, 0.1);
    --shadow-md: 0 4px 8px rgba(5, 56, 107, 0.15);
    --shadow-lg: 0 8px 16px rgba(5, 56, 107, 0.2);
    --shadow-holo: 0 8px 32px rgba(92, 219, 149, 0.3);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--background-color) 0%, #f8fffe 100%);
    color: var(--primary-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== HOLOGRAPHIC ANIMATIONS ===== */
@keyframes holographicShimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(92, 219, 149, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(92, 219, 149, 0.6);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER STYLES ===== */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-size: 200% 200%;
    animation: holographicShimmer 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--holo-gradient);
    opacity: 0.1;
    animation: holographicShimmer 4s ease-in-out infinite reverse;
}

.app-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.app-subtitle {
    font-size: 1.1rem;
    color: var(--light-accent);
    font-weight: var(--font-weight-light);
    position: relative;
    z-index: 1;
}

/* ===== CONVERTER CONTAINER ===== */
.converter-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-md);
    animation: fadeInUp 0.8s ease-out;
}

.converter-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(92, 219, 149, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--holo-gradient);
    animation: holographicShimmer 2s ease-in-out infinite;
}

.card-header {
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    background: linear-gradient(135deg, rgba(55, 150, 131, 0.1), rgba(92, 219, 149, 0.1));
}

.card-title {
    font-size: 1.8rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
}

.card-body {
    padding: var(--spacing-xl);
}

/* ===== FORM STYLES ===== */
.form-label {
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
}

.holographic-input,
.holographic-select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(92, 219, 149, 0.3);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.holographic-input:focus,
.holographic-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(92, 219, 149, 0.3);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.holographic-input::placeholder {
    color: rgba(5, 56, 107, 0.5);
}

/* ===== BUTTON STYLES ===== */
.holographic-btn {
    background: var(--holo-gradient);
    border: none;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 150px;
    box-shadow: var(--shadow-md);
}

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

.holographic-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-holo);
    animation: pulseGlow 1.5s ease-in-out infinite;
}

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

.holographic-btn:active {
    transform: translateY(-1px);
}

.holographic-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

/* ===== SPINNER ANIMATION ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ALERT STYLES ===== */
.alert {
    border-radius: var(--border-radius-md);
    border: none;
    font-weight: var(--font-weight-normal);
    animation: fadeInUp 0.5s ease-out;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background: linear-gradient(135deg, rgba(92, 219, 149, 0.1), rgba(92, 219, 149, 0.05));
    color: var(--primary-color);
    border-left: 4px solid var(--accent-color);
}

.error-icon,
.success-icon {
    margin-right: var(--spacing-sm);
    font-size: 1.2rem;
}

/* ===== RESULTS SECTION ===== */
.results-section {
    margin-top: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out;
}

.result-card {
    background: linear-gradient(135deg, rgba(92, 219, 149, 0.1), rgba(142, 228, 175, 0.1));
    border: 2px solid rgba(92, 219, 149, 0.3);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(92, 219, 149, 0.1) 0%, transparent 70%);
    animation: float 3s ease-in-out infinite;
    pointer-events: none;
}

.result-title {
    font-size: 1.3rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.result-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.result-from,
.result-to {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.result-value {
    font-size: 1.8rem;
    font-weight: var(--font-weight-bold);
    color: var(--secondary-color);
}

.result-unit {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: var(--font-weight-normal);
}

.result-arrow {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: var(--font-weight-bold);
}

.result-formula {
    font-size: 0.9rem;
    color: rgba(5, 56, 107, 0.7);
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* ===== HISTORY SECTION ===== */
.history-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(92, 219, 149, 0.3);
    animation: fadeInUp 0.7s ease-out;
}

.history-title {
    font-size: 1.2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.history-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(92, 219, 149, 0.2);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(92, 219, 149, 0.1);
    transform: translateX(5px);
}

/* ===== FOOTER STYLES ===== */
.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-top: auto;
}

.footer-link {
    color: var(--light-accent);
    text-decoration: none;
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: white;
    text-shadow: 0 0 10px rgba(142, 228, 175, 0.8);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }
    
    .app-subtitle {
        font-size: 1rem;
    }
    
    .converter-container {
        padding: var(--spacing-sm);
    }
    
    .card-body {
        padding: var(--spacing-lg);
    }
    
    .result-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .result-arrow {
        transform: rotate(90deg);
    }
    
    .holographic-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.8rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .converter-container {
        margin: var(--spacing-sm);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.holographic-input:focus,
.holographic-select:focus,
.holographic-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #333333;
        --accent-color: #006600;
        --background-color: #ffffff;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-holographic {
    background: var(--holo-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-holographic {
    border: 2px solid;
    border-image: var(--holo-gradient) 1;
}

.shadow-holographic {
    box-shadow: var(--shadow-holo);
}

/* ===== SCROLLBAR STYLES ===== */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(92, 219, 149, 0.1);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
