/**
 * Schoolopedia - Modern Directory Website
 * Version 1.5 - Professional Clean Design
 */

/* ================================
   CSS VARIABLES
================================ */
:root {
    /* Base Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F2F4F7;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    
    /* Primary Accent */
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #DBEAFE;
    
    /* Secondary Accents */
    --success-color: #16A34A;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    
    /* Borders */
    --border-color: #E5E7EB;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Font */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ================================
   RESET & BASE
================================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* ================================
   TOP BAR
================================ */
.top-bar {
    background: var(--text-primary);
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    padding: 0.625rem 0;
}

.top-bar a {
    color: rgba(255,255,255,0.8);
}

.top-bar a:hover {
    color: #fff;
}

.top-bar .social-links a {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    margin-left: 0.5rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.top-bar .social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* ================================
   NAVBAR
================================ */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

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

/* Mega Menu */
.mega-menu {
    min-width: 600px;
    border: none;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-xl);
    margin-top: 0.5rem;
}

.mega-menu .dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.mega-menu .dropdown-item:hover {
    background: var(--primary-light);
}

.category-icon-sm {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

/* ================================
   HERO CAROUSEL
================================ */
.hero-carousel {
    height: 100vh;
    min-height: 600px;
    max-height: 900px;
}

.hero-carousel .carousel-item {
    height: 100vh;
    min-height: 600px;
    max-height: 900px;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(37,99,235,0.5) 100%);
}

.carousel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 900px;
    padding: 0 2rem;
    z-index: 10;
}

.carousel-content h2 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

.carousel-content p {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 60px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    margin: 0 2rem;
    opacity: 0.8;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    background: rgba(255,255,255,0.3);
    opacity: 1;
}

.hero-carousel .carousel-indicators {
    bottom: 2rem;
}

.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 0.375rem;
    opacity: 0.5;
}

.hero-carousel .carousel-indicators button.active {
    opacity: 1;
}

/* ================================
   SEARCH BOX
================================ */
.search-box {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
}

.search-box .form-control {
    border: 1px solid var(--border-color);
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.search-box .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ================================
   SECTION STYLES
================================ */
.section-padding {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* ================================
   CATEGORY CARDS
================================ */
.category-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.category-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
    color: #fff;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-card h5 {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ================================
   LISTING CARDS
================================ */
.listing-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.listing-card .card-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.listing-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.listing-card .featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: #fff;
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.listing-card .category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.95);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.listing-card .card-body {
    padding: 1.5rem;
}

.listing-card .card-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.listing-card .card-title a {
    color: var(--text-primary);
}

.listing-card .card-title a:hover {
    color: var(--primary-color);
}

.listing-card .location {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ================================
   BUTTONS
================================ */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

/* ================================
   PAGE HEADER
================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    padding: 4rem 0;
    text-align: center;
    color: #fff;
}

.page-header h1 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    opacity: 0.9;
    font-size: 1.125rem;
}

/* ================================
   CARDS
================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.card-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

/* ================================
   FORMS
================================ */
.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

/* ================================
   DASHBOARD SIDEBAR
================================ */
.dashboard-sidebar {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
}

.dashboard-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.dashboard-sidebar .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-color) !important;
}

.dashboard-sidebar .nav-link.active {
    background: var(--primary-color);
    color: #fff !important;
}

.dashboard-sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

/* ================================
   ADMIN SIDEBAR FIX
================================ */
.admin-sidebar .nav-link.active,
.dashboard-sidebar .nav-link.active {
    background-color: #2563EB !important;
    color: #ffffff !important;
}

.admin-sidebar .nav-link.active i,
.dashboard-sidebar .nav-link.active i {
    color: #ffffff !important;
}

.admin-sidebar .nav-link.active .badge,
.dashboard-sidebar .nav-link.active .badge {
    background-color: #ffffff !important;
    color: #2563EB !important;
}

/* Override any theme color issues */
.admin-sidebar .nav-link,
.dashboard-sidebar .nav-link {
    color: #374151 !important;
}

.admin-sidebar .nav-link:hover,
.dashboard-sidebar .nav-link:hover {
    background-color: #EFF6FF !important;
    color: #2563EB !important;
}

.admin-sidebar .nav-link.active:hover,
.dashboard-sidebar .nav-link.active:hover {
    background-color: #1D4ED8 !important;
    color: #ffffff !important;
}

/* ================================
   STAT CARDS
================================ */
.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
}

/* ================================
   PRICING CARDS
================================ */
.pricing-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: 1rem;
    right: -2rem;
    background: var(--primary-color);
    color: #fff;
    padding: 0.375rem 2.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    transform: rotate(45deg);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 1.5rem 0;
}

.pricing-card .price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-card ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.pricing-card ul li i {
    color: var(--success-color);
    margin-right: 0.75rem;
}

/* ================================
   NEWSLETTER
================================ */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.newsletter-section .form-control {
    border: none;
    padding: 1rem 1.25rem;
}

/* ================================
   FOOTER
================================ */
.footer {
    background: var(--text-primary);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 1.5rem;
}

.footer h5 {
    color: #fff;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 0.25rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    margin-top: 3rem;
}

/* ================================
   WHATSAPP BUTTON
================================ */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: #fff;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ================================
   ADMIN HEADER
================================ */
.admin-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    padding: 1.5rem 0;
}

/* ================================
   QUILL EDITOR
================================ */
.ql-toolbar {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    background: var(--bg-secondary);
    border-color: var(--border-color) !important;
}

.ql-container {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
    border-color: var(--border-color) !important;
    font-family: var(--font-family);
    font-size: 1rem;
    min-height: 200px;
}

.ql-editor {
    min-height: 200px;
}

/* ================================
   TABLES
================================ */
.table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: none;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 991px) {
    .mega-menu {
        min-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    
    .hero-carousel,
    .hero-carousel .carousel-item {
        height: 70vh;
        min-height: 500px;
    }
    
    .carousel-content h2 {
        font-size: 2rem;
    }
    
    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next {
        display: none;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .dashboard-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .hero-carousel,
    .hero-carousel .carousel-item {
        height: 60vh;
        min-height: 450px;
    }
    
    .carousel-content h2 {
        font-size: 1.75rem;
    }
    
    .page-header {
        padding: 2.5rem 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 1rem;
        right: 1rem;
    }
}
