@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ==========================================
   CSS VARIABLES & THEME DEFINITIONS
   ========================================== */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Light Mode Variables */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.85);
    
    --color-primary: #0d9488;         /* Emerald/Teal */
    --color-primary-hover: #0f766e;
    --color-secondary: #f59e0b;       /* Amber/Gold */
    --color-secondary-hover: #d97706;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(13, 148, 136, 0.1);
    
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --hover-shadow: 0 20px 40px -15px rgba(13, 148, 136, 0.15);
    --transition-speed: 0.3s;
}

.dark-mode {
    /* Dark Mode Variables */
    --bg-primary: #0b0f19;
    --bg-secondary: #151e31;
    --bg-navbar: rgba(11, 15, 25, 0.85);
    
    --color-primary: #14b8a6;         /* Bright Teal */
    --color-primary-hover: #2dd4bf;
    --color-secondary: #fbbf24;       /* Gold */
    --color-secondary-hover: #fcd34d;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-inverse: #0b0f19;
    
    --border-color: #212e4a;
    --glass-bg: rgba(21, 30, 49, 0.75);
    --glass-border: rgba(20, 184, 166, 0.15);
    
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --hover-shadow: 0 20px 40px -15px rgba(20, 184, 166, 0.3);
}

/* ==========================================
   GLOBAL RESET & BASIC STYLING
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}
a:hover {
    color: var(--color-primary-hover);
}

/* ==========================================
   GLASSMORPHISM & UI ELEMENTS
   ========================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed) cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow var(--transition-speed),
                background var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.btn-theme {
    background-color: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all var(--transition-speed);
    font-family: var(--font-heading);
}

.btn-theme:hover {
    background-color: var(--color-primary-hover);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.btn-secondary-theme {
    background-color: var(--color-secondary);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all var(--transition-speed);
    font-family: var(--font-heading);
}

.btn-secondary-theme:hover {
    background-color: var(--color-secondary-hover);
    color: var(--text-inverse);
    transform: translateY(-2px);
}

/* ==========================================
   NAVIGATION BAR
   ========================================= */
.navbar-custom {
    background: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-speed), border-color var(--transition-speed);
    padding: 15px 0;
}

.navbar-custom .navbar-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--color-primary) !important;
}

.navbar-custom .nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color var(--transition-speed);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--color-primary) !important;
}

/* ==========================================
   HERO BANNER & CAROUSEL
   ========================================== */
.hero-carousel {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-top: -88px; /* Pull slider under transparent navigation menu */
}

.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.hero-carousel .carousel-item {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-carousel .carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(11, 15, 25, 0.3) 0%, rgba(11, 15, 25, 0.8) 100%);
}

.hero-carousel .carousel-caption {
    bottom: 25%;
    z-index: 10;
    text-align: center;
    padding-left: 15px;
    padding-right: 15px;
}

.hero-carousel .carousel-item .carousel-caption h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 900;
    color: #ffffff;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
}

.hero-carousel .carousel-item .carousel-caption p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) 0.3s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 35px;
}

.hero-carousel .carousel-item .carousel-caption .hero-btns {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) 0.6s;
}

/* Active animations */
.hero-carousel .carousel-item.active .carousel-caption h1,
.hero-carousel .carousel-item.active .carousel-caption p,
.hero-carousel .carousel-item.active .carousel-caption .hero-btns {
    opacity: 1;
    transform: translateY(0);
}

.navbar-overlay {
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.8) 0%, rgba(0, 0, 0, 0) 100%) !important;
    border-bottom: none !important;
    position: absolute;
    width: 100%;
    z-index: 1000;
}

.navbar-overlay .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-overlay .nav-link:hover,
.navbar-overlay .nav-link.active {
    color: var(--color-primary) !important;
}

.navbar-overlay .navbar-brand {
    color: #ffffff !important;
}

/* Local News styling */
.news-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card .news-img-container {
    height: 200px;
    overflow: hidden;
    position: relative;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.news-card .news-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.news-card:hover .news-img-container img {
    transform: scale(1.05);
}

/* ==========================================
   PORTALS SIDEBAR LAYOUT (ADMIN/MEMBER)
   ========================================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all var(--transition-speed);
}

.sidebar .nav-link i {
    margin-right: 12px;
    font-size: 1.15rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--color-primary);
    background-color: rgba(13, 148, 136, 0.08);
}

.dashboard-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* ==========================================
   METRIC DASHBOARD CARDS
   ========================================== */
.metric-card {
    border-left: 5px solid var(--color-primary);
}

.metric-card.secondary {
    border-left-color: var(--color-secondary);
}

.metric-card .metric-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin: 10px 0;
}

/* ==========================================
   BIRTHDAY AUTOMATION BANNER
   ========================================== */
.birthday-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
    border: 2px dashed var(--color-secondary);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.birthday-banner::before {
    content: '🎉';
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    left: 20px;
    top: 20px;
}

.birthday-banner::after {
    content: '🎂';
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    right: 20px;
    bottom: 20px;
}

.birthday-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-secondary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

/* ==========================================
   AI FLOATING CHATBOT WIDGET
   ========================================== */
.chatbot-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.3);
    z-index: 1000;
    transition: transform 0.2s, background-color var(--transition-speed);
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    background-color: var(--color-primary-hover);
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chatbot-header {
    background-color: var(--color-primary);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-msg.bot {
    background-color: var(--bg-primary);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid var(--border-color);
}

.chat-msg.user {
    background-color: var(--color-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chatbot-input-area input {
    flex: 1;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-main);
    border-radius: 8px;
    padding: 8px 12px;
}

.chatbot-input-area input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ==========================================
   PRIVATE CHAT PORTAL
   ========================================== */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--bg-primary);
}

.chat-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   EVENT COUNTDOWN TIMER
   ========================================== */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.countdown-box {
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid var(--glass-border);
    padding: 10px 18px;
    border-radius: 10px;
    text-align: center;
}

.countdown-box .num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary);
}

.countdown-box .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ==========================================
   PHOTO GALLERY LIGHTBOX
   ========================================== */
.gallery-grid img {
    cursor: pointer;
    transition: transform var(--transition-speed), filter var(--transition-speed);
}

.gallery-grid img:hover {
    transform: scale(1.03);
    filter: brightness(0.9);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* ==========================================
   PRINT STYLESHEET (REPORTS EXPORT)
   ========================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    
    .navbar-custom, 
    .sidebar, 
    .chatbot-bubble, 
    .chatbot-window, 
    .btn,
    footer,
    .no-print {
        display: none !important;
    }
    
    .dashboard-wrapper {
        display: block !important;
    }
    
    .dashboard-content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .card, .glass-card {
        border: 1px solid #ccc !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        page-break-inside: avoid;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    th, td {
        border: 1px solid #999 !important;
        padding: 8px !important;
    }
}

/* ==========================================
   RESPONSIVE MOBILE/TABLET SIDEBAR DRAWER
   ========================================== */
@media (max-width: 991.98px) {
    .dashboard-wrapper {
        display: block !important;
        padding-top: 60px; /* Space for fixed header bar */
    }
    
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
        background-color: var(--bg-secondary) !important;
        overflow-y: auto !important;
        max-height: 100vh !important;
        border-right: 1px solid var(--border-color) !important;
        padding: 20px 15px !important;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .dashboard-content {
        padding: 20px 15px !important;
        width: 100% !important;
    }
    
    /* Mobile dashboard header top bar */
    .dashboard-top-bar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        align-items: center;
        padding: 0 15px;
        z-index: 1030;
        transition: background-color var(--transition-speed);
    }
    
    /* Fix news layout card heights on mobile */
    .news-card .news-img-container {
        height: 150px;
    }
}

@media (min-width: 992px) {
    .dashboard-top-bar {
        display: none !important;
    }
}

