/**
 * دليل الجامعات والكليات اليمنية
 * Global Design System (Redesign v2.0)
 * Colors | Typography | Cards | Spacing | Animations
 */

:root {
    /* Color Palette - Royal Blue & Light Grey 2026 */
    --primary: #4169E1;       /* Royal Blue */
    --primary-light: #5A7FFF; /* Light Royal Blue */
    --primary-dark: #3152B5;  /* Dark Royal Blue */
    --primary-glass: rgba(65, 105, 225, 0.08);

    --secondary: #E0E0E0;     /* Light Grey defaults */
    --secondary-light: #F5F5F5;
    --secondary-dark: #BDBDBD;

    --accent: #FFD700;        /* Golden Yellow (Updated from Orange) */
    --highlight: #FFDE33;     /* Bright Yellow for badges */

    --bg-main: #F5F5F5;       /* Background - Light Grey */
    --bg-white: #FFFFFF;      /* Clean White for cards */
    --bg-dark: #1E3A8A;       /* Dark Royal Blue (Updated from Royal Blue) */

    --text-main: #222222;     /* Dark Black (Titles) */
    --text-muted: #555555;    /* Medium Soft Black */
    --text-white: #FFFFFF;

    --border: #E0E0E0;
    --border-light: #EEEEEE;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-premium: 0 20px 40px rgba(31, 122, 99, 0.1);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;

    /* Transition */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== GLOBAL RESET & TYPOGRAPHY ========== */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2.2rem;
}

h3 {
    font-size: 1.8rem;
}

p {
    color: #333333;
    line-height: 1.8;
}

a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ========== SECTION STYLING ========== */
.section-padding {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-title {
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

/* ========== CARD SYSTEM ========== */
.card-premium {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

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

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card-premium:hover .card-img-wrapper img {
    transform: scale(1.1);
}

.card-body-premium {
    padding: 24px;
    flex: 1;
}

/* ========== BUTTONS ========== */
.btn-premium {
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary-poly {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-white);
}

.btn-primary-poly:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px) !important;
    color: var(--text-white) !important;
}

.btn-secondary-poly {
    background: var(--secondary);
    color: var(--text-main);
}

.btn-secondary-poly:hover {
    background: var(--secondary-dark);
}

/* ========== ICON STYLING ========== */
.icon-box-premium {
    width: 60px;
    height: 60px;
    background: var(--primary-glass);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    transition: var(--transition);
}

/* ========== UTILITIES ========== */
.glass-morph {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bg-dark-poly {
    background: var(--bg-dark);
    color: var(--text-white);
}

@media (max-width: 1024px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .section-padding { padding: 80px 0; }
    .card-premium.p-5 { padding: 2.5rem !important; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    .section-padding { padding: 50px 0; }
    .section-title { font-size: 1.6rem; }
    .card-premium.p-5 { padding: 1.5rem !important; }
    
    .display-3 { font-size: 2.2rem !important; }
    .display-4 { font-size: 2.0rem !important; }
    
    .hero-btn-group { gap: 12px !important; }
    .hero-btn-group .btn-premium { width: 100%; height: auto !important; padding: 12px !important; }
}

@media (max-width: 576px) {
    .section-padding { padding: 35px 0 !important; }
    .section-header { margin-bottom: 25px; }
    .section-title { font-size: 1.4rem; }
    
    .card-premium { padding: 1rem !important; }
    .p-5 { padding: 1.25rem !important; }
    .p-4 { padding: 0.85rem !important; }
    
    .icon-box-premium { width: 45px; height: 45px; font-size: 1.15rem; margin-bottom: 15px; }
    
    /* Stats Bar overlapping fix */
    .glass-stats-card, .box-search-glass, div[style*="margin-top: -80px"], div[style*="margin-top: -85px"] { 
        margin-top: -30px !important; 
        padding: 1.25rem !important;
    }
}

/* Ensure images don't break containers */
img {
    height: auto;
    max-width: 100%;
    object-fit: cover;
}

/* Horizontal Table Helper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Premium Header Wrapper for generic guides */
.premium-header-wrapper {
    background: linear-gradient(135deg, var(--primary) 0%, #0c1b40 100%) !important;
    position: relative;
    overflow: hidden;
}
.premium-header-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}
.premium-header-wrapper::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* Hero Section stacking and sizing fixes */
.hero-premium-section {
    padding-top: 100px !important;
    padding-bottom: 60px !important;
    min-height: auto !important;
}

.uni-hero-wrapper {
    height: 480px;
    margin-top: 1rem;
    position: relative;
    border-radius: var(--radius-lg);
}

.hero-content {
    bottom: 3rem;
    right: 2rem;
    left: 2rem;
}

@media (max-width: 991px) {
    .uni-hero-wrapper { height: 350px; }
    .hero-content { bottom: 2rem; right: 1.5rem; left: 1.5rem; }
    .display-3 { font-size: 2.5rem !important; }
}

@media (max-width: 768px) {
    .uni-hero-wrapper { height: 300px; margin-top: 0; border-radius: 0; }
    .hero-content { bottom: 1.5rem; right: 1rem; left: 1rem; }
    .hero-content .fs-5 { font-size: 0.85rem !important; }
    .display-3 { font-size: 1.8rem !important; }
    
    .glass-stats-card {
        padding: 1.5rem !important;
        margin-top: -30px !important;
    }
    
    .uni-logo-box {
        width: 90px !important;
        height: 90px !important;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .uni-hero-wrapper { height: 240px; }
    .hero-content { bottom: 0.75rem; right: 0.75rem; left: 0.75rem; }
    .hero-content .breadcrumb, .hero-content .breadcrumb-item { display: none !important; }
    .display-3 { font-size: 1.45rem !important; }
    
    /* Stacking buttons in hero */
    .hero-btn-group { flex-direction: column !important; width: 100% !important; }
    .hero-btn-group .btn-premium, .hero-btn-group .beveled-btn { width: 100% !important; margin: 0 !important; }
    
    .section-padding { padding: 30px 0 !important; }
}

/* Modal and Dropdown adjustments for mobile */
.modal-dialog { margin: 8px; }
.dropdown-menu-custom { min-width: 100%; position: static !important; transform: none !important; opacity: 1 !important; visibility: visible !important; display: none; }
.header-nav li:hover .dropdown-menu-custom { display: block; }

/* Fix for any hardcoded 480px heights */
#panorama {
    height: 400px !important;
}
@media (max-width: 768px) {
    #panorama { height: 280px !important; }
}

/* Fix for horizontal scroll on some devices */
.row { margin-left: -10px; margin-right: -10px; }
.col, [class*="col-"] { padding-left: 10px; padding-right: 10px; }
.container { padding-left: 15px; padding-right: 15px; }