:root {
    /* Color Palette */
    --primary: #00BCD4;
    /* Cyan */
    --primary-dark: #0097A7;
    /* Darker Cyan */
    --primary-light: #B2EBF2;
    /* Light Cyan */

    --secondary: #4169E1;
    /* Royal Blue */
    --secondary-dark: #27408B;
    --secondary-light: #E6E6FA;

    --dark-bg: #0F172A;
    --light-bg: #F8FAFC;
    --card-bg: #FFFFFF;

    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #F1F5F9;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Spacing & Layout */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 40px; /* Space for the fixed bottom marquee */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(0, 188, 212, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(52, 65, 103, 0.289);
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Marquee */
.marquee-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 997; /* Below FABs (998) and Back to Top (999) */
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.5rem 0;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: flex;
    animation: marquee 40s linear infinite;
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

.marquee-content span {
    flex-shrink: 0;
    padding: 0 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.marquee-content span i {
    margin-right: 0.5rem;
    color: var(--primary);
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
    padding: 1.25rem 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo:hover .nav-logo-img {
    transform: scale(1.05) rotate(-3deg);
}

.logo:hover .nav-logo-tagline {
    -webkit-text-fill-color: var(--secondary);
    color: var(--secondary);
}

.nav-logo-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-logo-tagline {
    -webkit-text-fill-color: var(--text-muted); /* Override parent gradient */
    color: var(--text-muted); /* Fallback for other browsers */
    transition: color 0.3s ease;
}

.nav-logo-img {
    height: 80px;
    transition: height 0.3s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-links {
    display: flex;
    flex-grow: 1;
    justify-content: space-between;
    align-items: center;
}

.nav-links-main {
    display: flex;
    align-items: center;
}

.nav-links-main a {
    padding: 0 1.25rem;
}

.nav-separator {
    color: var(--primary-dark);
    opacity: 0.8;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary);
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    padding: 180px 0 100px;
    background-color: var(--dark-bg);
    min-height: 90vh;
    position: relative;
    overflow: hidden;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    display: flex;
    align-items: center;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 3;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 8s ease-out;
    transform: scale(1);
    z-index: -1;
}

.carousel-slide.active .slide-bg {
    transform: scale(1.1);
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.386), rgba(15, 23, 42, 0.386), rgba(15, 23, 42, 0.567));
    z-index: 0;
}

.hero-container {
    width: 100%;
    position: relative;
    z-index: 10;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 10;
    text-align: left;
    padding: 0;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    text-align: left;
}

/* Hero Content Animation */
.carousel-slide .hero-content h1,
.carousel-slide .hero-content p,
.carousel-slide .hero-content .hero-buttons {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Ensure static hero section text is visible when not in carousel mode */
.hero > .container .hero-content h1,
.hero > .container .hero-content p,
.hero > .container .hero-content .hero-buttons {
    opacity: 1;
    transform: translateY(0);
}

.carousel-slide.active .hero-content h1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s; /* Stagger animation */
}
.carousel-slide.active .hero-content p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}
.carousel-slide.active .hero-content .hero-buttons {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

/* Cards & Services */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-md);
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
    transform: scaleY(1);
}

.service-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Services Carousel */
.services-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem; /* Space for scrollbar if visible */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.services-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.services-carousel > .service-card {
    scroll-snap-align: start;
    flex: 0 0 80%;
}

@media (min-width: 600px) {
    .services-carousel > .service-card {
        flex-basis: 45%;
    }
}

@media (min-width: 768px) {
    .services-carousel > .service-card {
        flex-basis: 30%;
    }
}

@media (min-width: 1024px) {
    .services-carousel {
        /* Keep it a flex container on desktop, but with a larger gap */
        gap: 2rem; 
    }
    .services-carousel > .service-card {
        flex-basis: 22%; /* Adjust basis to show ~4 cards in the viewport */
    }
}

/* Team Cards */
.team-card {
    background: transparent; /* The info panel will have the background */
    border-radius: var(--radius-md);
    text-align: center;
    overflow: visible; /* Allow shadow from info to show */
    transition: all 0.4s ease;
    position: relative;
}

.team-card:hover {
    /* The hover effect is on the child elements */
}

.team-card:hover .team-info {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.team-card:hover .team-img {
    transform: scale(1.05);
}

.team-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: top;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease;
}

.team-info {
    background: white;
    padding: 2rem 1.5rem 1.5rem;
    margin: -4rem 1.5rem 0; /* Pull it up over the image */
    position: relative;
    z-index: 2;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
}

.team-name {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.team-title {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.team-socials {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.team-socials a {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.team-socials a:hover {
    color: var(--secondary);
    transform: scale(1.2);
}

/* Footer */
.site-footer {
    background-color: var(--dark-bg);
    color: var(--text-light);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: white;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a:hover {
    color: var(--primary);
}

.social-links {
    margin-top: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-right: 1.25rem;
}

.social-links a:last-child {
    margin-right: 0;
}

.social-links a:hover {
    color: var(--primary);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Admin Dashboard */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: white;
    border-right: 1px solid #e2e8f0;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    background-color: var(--light-bg);
}

.sidebar-menu {
    margin-top: 2rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: rgba(0, 188, 212, 0.1);
    color: var(--primary-dark);
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8fafc;
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

/* Blog Post Content Styling */
.blog-content-body {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-main); /* Ensure article content is always visible on white background */
}

.blog-content-body h2,
.blog-content-body h3,
.blog-content-body h4 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    line-height: 1.3;
}

.blog-content-body p {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.blog-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2.5rem auto;
    display: block;
    box-shadow: var(--shadow-lg);
}

.blog-content-body ul,
.blog-content-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-content-body ul {
    list-style: disc;
}

.blog-content-body ol {
    list-style: decimal;
}

.blog-content-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 2.5rem 0;
    font-style: italic;
    background-color: var(--light-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* For two-column layouts. In the editor's source code view, wrap content in: <div class="layout-grid"><div>Col 1</div><div>Col 2</div></div> */
.blog-content-body .layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2.5rem 0;
    align-items: center;
}

/* ========== ADMIN THEME OVERRIDES ========== */
.admin-body {
    background-color: var(--primary-dark);
}

.sidebar {
    background-color: var(--dark-bg);
    border-right-color: #1E293B;
}

.main-content {
    background-color: var(--primary-dark);
}

/* Sidebar Text & Links */
.sidebar div[style*="border-bottom"] {
    border-bottom-color: #1E293B !important;
}
.sidebar-link {
    color: var(--text-muted);
}
.sidebar-link:hover,
.sidebar-link.active {
    color: var(--primary);
    background-color: rgba(0, 188, 212, 0.08);
}
.sidebar div[style*="font-weight: 600"] {
    color: white;
}
.sidebar div[style*="border-top"] {
    border-top-color: #1E293B !important;
}
.sidebar .btn-secondary {
    border-color: #334155;
    color: var(--text-muted);
}
.sidebar .btn-secondary:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: white;
}

/* Main Content General Text */
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4,
.main-content p {
    color: white;
}
.main-content p[style*="color: var(--text-muted)"] {
    color: rgba(241, 245, 249, 0.7) !important; /* --text-light with opacity */
}

/* Main Content Cards & Panels */
.main-content .stat-card,
.main-content .table-container,
.main-content .glass-panel {
    background: var(--dark-bg);
    box-shadow: 0 4px 15px -3px rgb(0 0 0 / 0.5);
}

/* Card-specific text */
.main-content .stat-info h3 {
    color: white;
}

/* Tables */
.main-content table {
    color: var(--text-light);
}
.main-content th {
    background-color: #1E293B;
    color: var(--text-muted);
    border-bottom: 1px solid #334155;
}
.main-content td {
    border-bottom-color: #1E293B;
}
.main-content tr:last-child td {
    border-bottom: none;
}
.main-content .badge-success { background: rgba(16, 185, 129, 0.2); color: #6EE7B7; }
.main-content .badge-warning { background: rgba(245, 158, 11, 0.2); color: #FCD34D; }
.main-content .badge-danger { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }
.main-content .badge-info { background: rgba(59, 130, 246, 0.2); color: #93C5FD; }
.main-content span.badge[style*="background: var(--primary)"] {
    background: var(--primary) !important;
    color: var(--dark-bg) !important;
    font-weight: bold;
}

/* Modals */
div[id$="Modal"] > div {
    background: var(--dark-bg) !important;
}
div[id$="Modal"] h2,
div[id$="Modal"] .form-label {
    color: white;
}
div[id$="Modal"] .form-control {
    background-color: #1E293B;
    border-color: #334155;
    color: var(--text-light);
}
div[id$="Modal"] .form-control:focus {
    background-color: #1E293B;
    border-color: var(--primary);
}
div[id$="Modal"] button[style*="background: none"] {
    color: white;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-header .btn-secondary {
    border-color: rgba(255,255,255,0.2);
    color: white;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-header .btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
}
.admin-header .notification-wrapper {
    flex: initial;
}

/* ========== SIDEBAR COLLAPSE ========== */
.sidebar, .main-content, .admin-footer {
    transition: all 0.3s ease-in-out;
}

.admin-layout.sidebar-collapsed .sidebar {
    width: 80px;
    overflow-x: hidden;
}

.admin-layout.sidebar-collapsed .main-content {
    margin-left: 80px;
}

.admin-layout.sidebar-collapsed .sidebar-text {
    display: none;
}

.admin-layout.sidebar-collapsed .sidebar-link {
    justify-content: center;
}

.admin-layout.sidebar-collapsed .sidebar-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.admin-layout.sidebar-collapsed .sidebar a[href="profile.php"] > div {
    justify-content: center;
}

.admin-layout.sidebar-collapsed .admin-footer {
    margin-left: 80px;
}

/* ========== ADMIN LIGHT MODE ========== */
body.light-mode.admin-body {
    background-color: var(--light-bg);
}
body.light-mode .sidebar {
    background-color: white;
    border-right-color: #e2e8f0;
}
body.light-mode .main-content {
    background-color: var(--light-bg);
}
body.light-mode .sidebar div[style*="border-bottom"],
body.light-mode .sidebar div[style*="border-top"] {
    border-color: #e2e8f0 !important;
}
body.light-mode .sidebar div[style*="font-weight: 600"] {
    color: var(--text-main);
}
body.light-mode .sidebar .btn-secondary {
    border-color: #e2e8f0;
    color: var(--text-muted);
}
body.light-mode .sidebar .btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}
body.light-mode .main-content h1,
body.light-mode .main-content h2,
body.light-mode .main-content h3,
body.light-mode .main-content h4,
body.light-mode .main-content p {
    color: var(--text-main);
}
body.light-mode .main-content p[style*="color: var(--text-muted)"] {
    color: var(--text-muted) !important;
}
body.light-mode .main-content .stat-card,
body.light-mode .main-content .table-container,
body.light-mode .main-content .glass-panel {
    background: white;
    box-shadow: var(--shadow-sm);
}
body.light-mode .main-content .stat-info h3 {
    color: var(--text-main);
}
body.light-mode .main-content th {
    background-color: #f8fafc;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
}
body.light-mode .main-content td {
    border-bottom-color: #e2e8f0;
}
body.light-mode .main-content table {
    color: var(--text-main);
}
/* Modals in light mode inherit default styles mostly, but we ensure bg is white */
body.light-mode div[id$="Modal"] > div {
    background: white !important;
}
body.light-mode div[id$="Modal"] h2,
body.light-mode div[id$="Modal"] .form-label {
    color: var(--text-main);
}
body.light-mode div[id$="Modal"] .form-control {
    background-color: white;
    border-color: #e2e8f0;
    color: var(--text-main);
}
body.light-mode div[id$="Modal"] button[style*="background: none"] {
    color: var(--text-main);
}
body.light-mode .admin-header {
    border-bottom-color: #e2e8f0;
    background-color: transparent;
}
body.light-mode .admin-header .btn-secondary {
    border-color: #e2e8f0;
    color: var(--text-muted);
}
body.light-mode .admin-header .btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}
body.light-mode .admin-footer {
    background-color: white;
    border-top: 1px solid #e2e8f0;
    color: var(--text-muted);
}

/* ========== NOTIFICATION SYSTEM ========== */
.notification-wrapper {
    position: relative;
    flex: 1;
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid var(--dark-bg);
}
body.light-mode .notification-badge {
    border-color: white;
}
.notification-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    width: 300px;
    background-color: var(--dark-bg);
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1010;
    overflow: hidden;
}
body.light-mode .notification-dropdown {
    background-color: white;
    border-color: #e2e8f0;
}
.notification-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #334155;
}
body.light-mode .notification-header {
    border-bottom-color: #e2e8f0;
}
.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
    color: var(--text-light);
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background-color: #1E293B; }
body.light-mode .notification-item { color: var(--text-main); }
body.light-mode .notification-item:hover { background-color: var(--light-bg); }
.notification-title { font-size: 0.875rem; }
.notification-date { font-size: 0.75rem; color: var(--text-muted); }

/* Profile Dropdown */
.profile-dropdown-wrapper {
    position: relative;
}
.profile-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
}
.profile-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid rgba(255,255,255,0.2);
}
.profile-dropdown {
    display: none;
    position: absolute;
    top: 140%;
    right: 0;
    width: 220px;
    background-color: var(--dark-bg);
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1010;
    overflow: hidden;
}
.profile-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #334155;
}
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
}
.profile-dropdown-item .fa-fw { width: 20px; }
.profile-dropdown-item:hover { background-color: #1E293B; }
body.light-mode .profile-dropdown { background-color: white; border-color: #e2e8f0; }
body.light-mode .profile-dropdown-header { border-bottom-color: #e2e8f0; }
body.light-mode .profile-dropdown-item { color: var(--text-main); }
body.light-mode .profile-dropdown-item:hover { background-color: var(--light-bg); }

/* Admin Footer */
.admin-footer {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    z-index: 1005;
    padding: 0.75rem 1rem;
    background-color: var(--dark-bg);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.25);
}

.admin-layout.sidebar-collapsed .admin-footer {
    left: 80px;
}

.main-content {
    padding-bottom: 3.25rem; /* avoid overlapping footer */
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablets (768px to 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1rem;
    }

    .navbar {
        padding: 1rem 0;
    }

    .nav-links a {
        margin-left: 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-content {
        max-width: 100%;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    th,
    td {
        padding: 0.75rem 1rem;
    }
}

/* Small Tablets and Large Phones (600px to 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 0.75rem;
    }

    /* Navigation */
    .navbar {
        position: fixed;
        z-index: 1000;
        padding: 0.75rem 0;
    }

    .nav-container {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0 0.75rem;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        border-bottom: 1px solid #e2e8f0;
        padding: 1rem 0.75rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.active {
        max-height: 500px;
    }

    .nav-links a {
        margin-left: 0;
        padding: 0.75rem 0;
        font-size: 0.875rem;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-links-main {
        display: contents;
    }

    .nav-separator {
        display: none;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .logo {
        font-size: 0.8rem;
        width: auto;
        text-align: left;
        margin: 0;
        display: block !important;
        -webkit-text-fill-color: initial;
        background: none;
        color: var(--primary);
    }

    .logo>div {
        flex-direction: row !important;
        justify-content: flex-start !important;
    }

    .nav-logo-text-container {
        align-items: flex-start;
        line-height: 1.2;
    }

    .nav-logo-text-container span {
        font-weight: 800;
        background: linear-gradient(to right, var(--primary), var(--secondary));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        display: block;
    }

    .nav-logo-img {
        height: 40px;
        margin-right: 8px !important;
    }

    .nav-logo-tagline {
        font-size: 0.55rem !important;
        display: block !important;
        white-space: nowrap;
        -webkit-text-fill-color: var(--text-muted);
    }

    /* Hero Section */
    .hero {
        padding: 140px 0 50px;
        min-height: 60vh;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .hero-content {
        max-width: 100%;
        margin-left: 0;
        padding-left: 1.5rem;
    }

    .hero-content div[style*="display: flex"] {
        flex-direction: column;
    }

    .btn {
        width: 50px;
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }

    /* Sections */
    .section {
        padding: 2rem 0;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 1.5rem;
    }

    .section-title p {
        font-size: 0.9rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        padding: 1.25rem;
    }

    /* Contact Page Grid */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .blog-content-body .layout-grid {
        grid-template-columns: 1fr;
    }

    /* Admin Layout */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .sidebar>div:first-child {
        display: none;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .sidebar-link {
        flex: 1;
        min-width: 120px;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    /* Dashboard Stats */
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    /* Tables */
    th,
    td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    table {
        font-size: 0.85rem;
    }

    /* Footer */
    .site-footer {
        padding: 2rem 0 1rem;
    }

    .footer-grid {
        gap: 2rem;
    }

    /* Forms */
    .form-control {
        padding: 0.65rem 0.75rem;
    }
}

/* Mobile Phones (320px to 599px) */
@media (max-width: 599px) {
    .container {
        padding: 0 0.5rem;
    }

    /* Typography */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    h3 {
        font-size: 1rem;
    }

    /* Navigation */
    .navbar {
        position: fixed;
        top: 0;
        align-items: center;
        z-index: 1000;
        padding: 0.75rem 0;
        width: 100%;
        background: white; /* Ensure solid background to prevent overlap issues */
    }

    .nav-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0 0.75rem;
        min-height: 56px;
    }

    .menu-toggle {
        display: flex;
    }

    .logo {
        font-size: 0.85rem;
        text-align: center;
        flex: 0 0 auto;
        width: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .logo div {
        font-size: 0.85rem;
    }

    .logo > div {
        flex-direction: column !important;
        align-items: center !important;
    }

    .logo div:last-child {
        display: block !important;
    }

    .nav-logo-text-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        line-height: 1.1;
    }

    .nav-logo-img {
        margin-right: 0 !important;
        margin-bottom: 5px;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: auto;
        right: 0;
        background: white;
        display: flex;
        flex-direction: column;
        width: 50%;
        gap: 0;
        border-bottom: 1px solid #e2e8f0;
        padding: 0rem 0.5rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 999;
    }

    .nav-links.active { 
        max-height: 600px;
    }

    .nav-links a {
        margin-left: 0;
        padding: 1rem;
        font-size: 1rem;
        border-bottom: 1px solid #f1f5f9;
        display: block;
        text-align: left;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a.btn {
        width: 100%;
        margin-left: 0 !important;
        padding: 0.45rem 0.5rem !important;
        text-align: center;
    }

    /* Hero Section */
    .hero {
        padding: 120px 0 30px;
        min-height: 50vh;
    }

    .hero h1 {
        font-size: 1.3rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .hero p {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .hero-content {
        margin-left: 0;
        padding-left: 0.75rem;
    }

    .hero-content div[style*="display: flex"] {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 50%;
        padding: 0.45rem 0.65rem;
        font-size: 0.85rem;
        min-height: auto;
    }

    /* Sections */
    .section {
        padding: 1.5rem 0;
    }

    .section-title {
        margin-bottom: 1.5rem;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .section-title p {
        font-size: 0.8rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .service-card {
        padding: 1rem;
    }

    .service-card h3 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .service-card p {
        font-size: 0.8rem;
    }

    /* Contact Page */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Admin Layout */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.5rem;
        margin-bottom: 0;
    }

    .sidebar>div:first-child {
        display: none;
    }

    .sidebar-link {
        padding: 0.5rem;
        font-size: 0;
        flex: 1;
        min-width: 50px;
        justify-content: center;
    }

    .sidebar-link i {
        margin-right: 0;
        width: auto;
        font-size: 1.25rem;
    }

    .sidebar-menu {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .main-content {
        margin-left: 0;
        padding: 0.75rem;
    }

    /* Dashboard Stats */
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem;
        flex-direction: row;
        align-items: center;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
        margin-bottom: 0;
    }

    .stat-info h3 {
        font-size: 1.1rem;
    }

    .stat-info p {
        font-size: 0.7rem;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 500px;
        font-size: 0.75rem;
    }

    th,
    td {
        padding: 0.4rem 0.5rem;
    }

    th {
        font-size: 0.7rem;
    }

    /* Footer */
    .site-footer {
        padding: 1.5rem 0 0.75rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-col h4 {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }

    .footer-col ul li {
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
    }

    .copyright {
        padding-top: 1rem;
        font-size: 0.75rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .form-control {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    /* Glass Panel */
    .glass-panel {
        padding: 1rem !important;
    }
}

/* Contact Grid Responsive */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .contact-grid {
        gap: 2rem;
    }
}

@media (max-width: 767px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }
}

@media (max-width: 599px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }
}

/* Back to Top Button */
#backToTopBtn {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    border: none;
    outline: none;
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.4s, transform 0.4s, visibility 0.4s;
    transform: translateY(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#backToTopBtn.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

#backToTopBtn:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
}

/* Contact FAB (Floating Action Button) */
.contact-fab-wrapper {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 998;
}

.contact-fab-toggle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
    z-index: 2;
}

.contact-fab-toggle:hover {
    transform: scale(1.1);
}

.contact-fab-toggle.active {
    background: var(--danger);
    transform: rotate(360deg);
}

.contact-fab-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.contact-fab-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.contact-fab-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-fab-item:hover {
    transform: scale(1.15) translateX(5px);
}