/* Theme Variables */

/* Light Theme (Default) */
.theme-light {
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    
    /* Card Styles */
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-bg-accent: rgba(255, 255, 255, 0.9);
    --card-border: rgba(226, 232, 240, 0.6);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    /* Input Styles */
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: rgba(226, 232, 240, 0.8);
    
    /* Button Styles */
    --btn-secondary-bg: rgba(255, 255, 255, 0.8);
    --btn-secondary-text: rgba(15, 23, 42, 0.8);
    --btn-secondary-border: rgba(226, 232, 240, 0.8);
    --btn-secondary-hover-bg: rgba(241, 245, 249, 0.9);
    --btn-text-hover-bg: rgba(241, 245, 249, 0.5);
    
    /* Border Colors */
    --border-color: rgba(226, 232, 240, 0.8);
    
    /* Toggle Theme */
    --toggle-bg: #e2e8f0;
    --toggle-border: #cbd5e1;
    --toggle-thumb: #ffffff;
    --toggle-icon: #64748b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1));
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    
    /* Special Effects */
    --glow-primary: 0 0 15px rgba(99, 102, 241, 0.5);
    --glow-secondary: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Dark Theme */
.theme-dark {
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    /* Text Colors */
    --text-primary: rgba(248, 250, 252, 0.9);
    --text-secondary: rgba(248, 250, 252, 0.65);
    --text-tertiary: rgba(248, 250, 252, 0.4);
    
    /* Card Styles */
    --card-bg: rgba(30, 41, 59, 0.8);
    --card-bg-accent: rgba(30, 41, 59, 0.9);
    --card-border: rgba(51, 65, 85, 0.6);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    
    /* Input Styles */
    --input-bg: rgba(30, 41, 59, 0.8);
    --input-border: rgba(51, 65, 85, 0.8);
    
    /* Button Styles */
    --btn-secondary-bg: rgba(30, 41, 59, 0.8);
    --btn-secondary-text: rgba(248, 250, 252, 0.8);
    --btn-secondary-border: rgba(51, 65, 85, 0.8);
    --btn-secondary-hover-bg: rgba(51, 65, 85, 0.9);
    --btn-text-hover-bg: rgba(51, 65, 85, 0.5);
    
    /* Border Colors */
    --border-color: rgba(51, 65, 85, 0.8);
    
    /* Toggle Theme */
    --toggle-bg: #334155;
    --toggle-border: #475569;
    --toggle-thumb: #f8fafc;
    --toggle-icon: #cbd5e1;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(16, 185, 129, 0.2));
    --gradient-card: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(30, 41, 59, 0.7));
    
    /* Special Effects */
    --glow-primary: 0 0 15px rgba(99, 102, 241, 0.7);
    --glow-secondary: 0 0 15px rgba(16, 185, 129, 0.7);
}

/* Apply Theme Specific Styles */
body {
    background-image: var(--gradient-primary);
    background-attachment: fixed;
}

.glass-card {
    background-image: var(--gradient-card);
}

/* Glassmorphism Effects */
.glass-card {
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* Neumorphism Effects */
.theme-light .btn-primary {
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1),
                -5px -5px 10px rgba(255, 255, 255, 0.8);
}

.theme-dark .btn-primary {
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3),
                -5px -5px 10px rgba(255, 255, 255, 0.05);
}

/* Glowing Effects */
.btn-primary:hover {
    box-shadow: var(--glow-primary);
}

.btn-secondary:hover {
    box-shadow: var(--glow-secondary);
}

/* 3D Effects */
.profile-avatar, .logo {
    position: relative;
}

.profile-avatar::before, .logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), transparent, var(--secondary-color));
    z-index: -1;
    border-radius: inherit;
    opacity: 0.7;
    animation: rotate 3s linear infinite;
}

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

/* Theme Transition */
body, .glass-card, .btn-primary, .btn-secondary, .input-group, .theme-toggle, .toggle-thumb {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Light Reflections */
.glass-card:hover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: rotate(30deg);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: reflection 2s ease-in-out;
}

@keyframes reflection {
    0% { opacity: 0; }
    50% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* Soft Shadows for Cards */
.theme-light .glass-card {
    box-shadow: 
        10px 10px 20px rgba(0, 0, 0, 0.05),
        -10px -10px 20px rgba(255, 255, 255, 0.8);
}

.theme-dark .glass-card {
    box-shadow: 
        10px 10px 20px rgba(0, 0, 0, 0.3),
        -10px -10px 20px rgba(255, 255, 255, 0.03);
}

/* Animated Gradient Backgrounds */
.intro-card {
    background-size: 200% 200%;
    background-image: linear-gradient(45deg, 
        var(--card-bg) 0%, 
        var(--card-bg-accent) 25%, 
        var(--card-bg) 50%, 
        var(--card-bg-accent) 75%, 
        var(--card-bg) 100%);
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Button Hover Effects */
.btn-primary::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::after {
    opacity: 0.3;
}

/* Smooth Page Transitions */
.app-container {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Hover Card Effects */
.transaction-card:hover {
    transform: translateY(-5px) scale(1.01);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Animated Icons */
.lucide {
    transition: transform 0.3s ease;
}

.btn:hover .lucide, .btn-icon:hover .lucide {
    transform: scale(1.2);
}

/* Responsive Theme Adjustments */
@media (max-width: 768px) {
    .theme-light .glass-card, .theme-dark .glass-card {
        box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1),
                    -5px -5px 10px rgba(255, 255, 255, 0.1);
    }
}