/* 
   ==========================================================================
   AIGEO GLOBAL RESPONSIVE STYLES
   ==========================================================================
   Optimizations for various device types and screen sizes.
   Included in all pages for consistency.
*/

:root {
    --primary: #0D9488;
    --primary-light: #F0FDFA;
    --primary-dark: #0F766E;
    --secondary: #10B981;
    --text-main: #1E293B;
    --text-light: #64748B;
    --bg-body: #F8FAFC;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --primary-gradient: linear-gradient(135deg, #0D9488 0%, #10B981 100%);
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-y: scroll;
}

body {
    font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

/* Base Utility Classes */
.glass {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 8px 32px 0 rgba(13, 148, 136, 0.05) !important;
}

/* Typography Responsive Scaling */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.2; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.2; }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.3; }
p { font-size: clamp(0.9rem, 1.5vw, 1rem); }

/* --- RESPONSIVE LAYOUTS --- */

/* Desktop & Large Screens (Default) */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex-grow: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* Tablet (Max 1024px) */
@media (max-width: 1024px) {
    /* Sidebars */
    .sidebar {
        width: 240px;
    }
    
    /* Hero sections */
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
        padding-top: 100px;
    }
    
    .hero-text {
        text-align: center;
    }
    
    /* Bento Cards grids removed to allow native Tailwind grids */
}

/* Mobile (Max 768px) */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    body {
        /* Preserve flex layouts but adjust for mobile */
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
    }

    main {
        /* Ensure main leaves room for the fixed bottom nav */
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        overflow: visible !important;
        padding-bottom: 80px !important; 
    }

    /* Container Adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Bottom Navigation Menu for Mobile */
    .sidebar {
        width: 100% !important;
        height: 65px !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        flex-direction: row !important;
        border-right: none !important;
        border-top: 1px solid #E2E8F0 !important;
        background: white !important;
        z-index: 1000 !important;
        display: flex !important;
        padding: 0 !important;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    }

    .sidebar .p-8, .nav-group-title, .sidebar .p-4.border-t {
        display: none !important;
    }

    .sidebar nav {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 !important;
    }

    .sidebar-link {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100% !important;
        font-size: 0 !important;
        position: relative !important;
    }

    .sidebar-link i, .sidebar-link svg {
        width: 22px !important;
        height: 22px !important;
        margin: 0 !important;
    }

    .sidebar-link.active {
        background: transparent !important;
        color: var(--primary) !important;
        box-shadow: none !important;
    }

    .sidebar-link.active::after {
        content: '';
        position: absolute;
        top: -1px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        background: var(--primary);
        border-radius: 0 0 4px 4px;
    }

    /* Reverted mobile header to default style */

    .tabs-pill-container {
        display: flex !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .tabs-pill-container::-webkit-scrollbar {
        display: none !important;
    }

    /* Gentle aesthetic adjustments for mobile cards */
    .bento-card {
        padding: 1.25rem !important; /* 20px padding on mobile instead of 32px */
        border-radius: 20px !important;
    }
    
    /* Removed brutal grid and spacing overrides to allow native Tailwind responsive classes to work elegantly */
    
    /* Stats & Badges */
    .stat-badge {
        width: 36px;
        height: 36px;
    }
    
    /* Tables responsiveness (overflow) */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Modals & Popups */
    .modal-content {
        width: 95% !important;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Mobile floating action buttons */
    .mobile-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Small Mobile (Max 480px) */
@media (max-width: 480px) {
    /* Extreme layout compacting */
    .hero h1 { font-size: 1.8rem; }
    
    .btn-modern, .btn-primary {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    /* Auth pages specific fixes */
    .auth-container {
        padding: 1rem;
    }
    .auth-card {
        padding: 1.5rem 1rem !important;
    }
}

/* Custom Scrollbar for all platforms */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Utility Animations */
.fade-up {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Flex utilities for forced responsive behavior */
.responsive-flex-col {
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    .responsive-flex-col {
        flex-direction: row;
    }
}


/* ==========================================================================
   AIGEO GLOBAL UI (TOASTS & ALERTS)
   ========================================================================== */

/* --- TOAST CONTAINER --- */
#aigeo-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

@media (max-width: 768px) {
    #aigeo-toast-container {
        bottom: 80px; /* Above mobile bottom nav */
        left: 16px;
        right: 16px;
        align-items: center;
    }
}

/* --- TOAST NOTIFICATION --- */
.aigeo-toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 40px -10px rgba(13, 148, 136, 0.15);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 100%;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom center;
}

.aigeo-toast.toast-hiding {
    animation: toastFadeOut 0.3s ease forwards;
}

.aigeo-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.aigeo-toast-icon.success { background: #F0FDFA; color: #0D9488; }
.aigeo-toast-icon.error { background: #FEF2F2; color: #EF4444; }
.aigeo-toast-icon.info { background: #EFF6FF; color: #3B82F6; }

.aigeo-toast-text {
    color: #1E293B;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
}

@keyframes toastSlideIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastFadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

/* --- CUSTOM ALERT MODAL --- */
.aigeo-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: alertFadeIn 0.3s ease forwards;
}

.aigeo-alert-box {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 32px 24px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    transform: scale(0.95);
    animation: alertScaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.aigeo-alert-icon {
    width: 64px;
    height: 64px;
    background: #F0FDFA;
    color: #0D9488;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.aigeo-alert-icon svg { width: 32px; height: 32px; }

.aigeo-alert-text {
    color: #1E293B;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 32px;
}

.aigeo-alert-btn {
    background: linear-gradient(135deg, #0D9488 0%, #10B981 100%);
    color: white;
    font-weight: 800;
    font-size: 1rem;
    padding: 14px 24px;
    border-radius: 100px;
    width: 100%;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(13, 148, 136, 0.3);
    transition: all 0.3s;
}

.aigeo-alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(13, 148, 136, 0.4);
}

@keyframes alertFadeIn { to { opacity: 1; } }
@keyframes alertScaleIn { to { transform: scale(1); } }
.aigeo-alert-overlay.alert-hiding { animation: alertFadeOut 0.3s ease forwards; }
@keyframes alertFadeOut { from { opacity: 1; } to { opacity: 0; } }
