/* --- CORE ANIMATIONS --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounceSubtle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* OPTIMIZED GLOWS (Less blurry on mobile) */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(93, 92, 222, 0.3), inset 0 0 10px rgba(93, 92, 222, 0.1); }
    50% { box-shadow: 0 0 25px rgba(93, 92, 222, 0.5), inset 0 0 20px rgba(93, 92, 222, 0.2); }
}

@keyframes neon-flicker {
    0%, 100% { opacity: 1; text-shadow: 0 0 5px rgba(93, 92, 222, 0.5); }
    50% { opacity: 0.95; text-shadow: 0 0 15px rgba(93, 92, 222, 0.8); }
}

/* --- LAYOUT UTILS --- */
.tab-content { display: none; animation: fadeIn 0.5s ease-in-out; }
.tab-content.active { display: block; }

/* --- CARDS & PANELS --- */
.glass-morphism {
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dark .glass-morphism {
    background: rgba(17, 24, 39, 0.85); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tool-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 1px solid rgba(229, 231, 235, 1);
}

.dark .tool-card {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.4);
}

/* --- BUTTONS & INPUTS --- */
.glow-btn {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(93, 92, 222, 0.3);
    transition: all 0.3s ease;
    background: #5D5CDE; 
    color: white !important;
    font-weight: 700;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #4B5563; 
}

.dark .tab-btn {
    color: #E5E7EB !important; 
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn:hover {
    background: rgba(93, 92, 222, 0.1);
    color: #5D5CDE !important;
}

.tab-btn.glow-btn {
    background: linear-gradient(135deg, #5D5CDE, #7B7AE8);
    color: white !important;
    box-shadow: 0 0 20px rgba(93, 92, 222, 0.4);
}

.input-field {
    background: white;
    color: #1F2937;
    border: 1px solid #D1D5DB;
}

.dark .input-field {
    background: #374151; 
    color: white;
    border: 1px solid #4B5563;
}

/* --- TEXT STYLES --- */
.glow-text {
    text-shadow: 0 0 15px rgba(93, 92, 222, 0.4); 
}

/* --- BADGES (Restored!) --- */
.metric-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(93, 92, 222, 0.2); /* The Blue Pill Background */
    border: 1px solid rgba(93, 92, 222, 0.4);
    color: #e0e7ff; /* Light text */
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* Pill Shape */
    font-weight: 600;
    font-size: 0.875rem;
    backdrop-filter: blur(4px);
}

/* --- UTILITIES --- */
.break-words { word-wrap: break-word; overflow-wrap: break-word; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================
   MOBILE & TABLET NAVIGATION FIXES (FINAL)
   ========================================= */

#main-nav {
    border-radius: 16px !important;
    height: auto !important;
    min-height: auto !important;
    padding: 12px !important;
}

/* 1. TABLET VIEW (iPad / Small Laptops) */
@media (min-width: 641px) and (max-width: 1024px) {
    #main-nav {
        width: fit-content !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    
    #main-nav > div { display: contents !important; }

    .tab-btn {
        flex: 1 1 auto;
        min-width: 110px;
        margin: 0 !important;
    }
    
    .text-4xl, h1, h2 {
        text-shadow: none !important;
        filter: none !important;
    }
}

/* 2. PHONE VIEW (Mobile) */
@media (max-width: 640px) {
    #main-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; 
        gap: 8px !important;
        width: 95% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }
    
    #main-nav > div { display: contents !important; }

    .tab-btn:nth-child(5) {
        grid-column: span 2;
    }

    .tab-btn {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: 0.9rem !important;
        padding: 12px 4px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .text-4xl, h1, h2 {
        text-shadow: none !important;
        filter: none !important;
    }

    .grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem !important;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
}