/* ==========================================================================
   TERDPI - Yagona Ta'lim Portali Design System
   Modern Premium University Portal Style
   ========================================================================== */

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;

    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.25);
    
    --accent: #7c3aed;
    --accent-light: #f5f3ff;
    
    --success: #10b981;
    --success-light: #ecfdf5;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.85);
    
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    --shadow-card-hover: 0 22px 40px -8px rgba(79, 70, 229, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.05);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: #f8fafc;
    color: var(--slate-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Lights */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    top: -150px;
    left: -150px;
}

.glow-2 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
    top: 20%;
    right: -200px;
}

.glow-3 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    bottom: 5%;
    left: 15%;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: translateY(-1px);
}

.logo-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

.logo-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-institution {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary);
    line-height: 1.2;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-700);
    text-decoration: none;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-btn:hover {
    color: var(--primary);
    background: var(--slate-50);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.nav-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.3);
}

.nav-btn-accessibility {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25) !important;
}

.nav-btn-accessibility:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%) !important;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35) !important;
    transform: translateY(-2px);
}

.nav-svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 48px 0 72px 0;
    position: relative;
    z-index: 1;
}

.hero-section {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 52px auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
    margin-bottom: 20px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--slate-900);
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.hero-br {
    display: block;
}

.gradient-text {
    background: linear-gradient(135deg, #1e40af 0%, #4f46e5 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--slate-600);
    max-width: 720px;
    margin: 0 auto 36px auto;
    line-height: 1.6;
}

/* Search Bar */
.search-wrapper {
    max-width: 720px;
    margin: 0 auto 28px auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 6px 10px 6px 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-md);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--slate-400);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--slate-800);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--slate-400);
}

.clear-search-btn {
    background: var(--slate-100);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--slate-500);
    margin-right: 8px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: var(--slate-200);
    color: var(--slate-800);
}

.search-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

/* Filter Chips */
.filter-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-600);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.chip:hover {
    background: var(--slate-50);
    color: var(--slate-900);
    border-color: var(--slate-300);
}

.chip.active {
    background: var(--slate-900);
    color: white;
    border-color: var(--slate-900);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.chip-count {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.chip:not(.active) .chip-count {
    background: var(--slate-100);
    color: var(--slate-600);
}

/* ==========================================================================
   Cards Grid
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
    margin-bottom: 48px;
}

.site-card-wrapper {
    display: flex;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.site-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    position: relative;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(99, 102, 241, 0.4);
}

/* Card Media */
.card-media {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--slate-100);
}

.card-badges {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}

.badge-number {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-600);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #065f46;
    background: rgba(236, 253, 245, 0.9);
    backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(167, 243, 208, 0.8);
}

.status-pulse {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.site-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px 20px;
    transition: transform 0.4s ease;
}

.site-card:hover .site-card-image {
    transform: scale(1.05);
}

.site-card-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px 20px;
}

.site-card-placeholder {
    color: var(--slate-300);
}

/* Card Body */
.site-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 24px;
}

.card-domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
    margin-bottom: 12px;
}

.site-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--slate-900);
    letter-spacing: -0.2px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2rem;
    transition: color 0.2s ease;
}

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

.site-card-description {
    font-size: 0.875rem;
    color: var(--slate-500);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Action Button */
.card-action {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.2s ease;
}

.action-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-card:hover .action-arrow {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

/* No Results State */
.no-results-state, .empty-state {
    text-align: center;
    padding: 64px 24px;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px dashed var(--slate-300);
    max-width: 600px;
    margin: 32px auto;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-results-state h3, .empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 8px;
}

.no-results-state p, .empty-state p {
    color: var(--slate-500);
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-secondary {
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
}

.btn-secondary:hover {
    background: var(--slate-200);
    color: var(--slate-900);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
    background: white;
    border-top: 1px solid var(--slate-200);
    padding: 36px 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo img {
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.footer-logo h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--slate-800);
    line-height: 1.2;
}

.footer-logo p {
    font-size: 0.8rem;
    color: var(--slate-500);
}

.footer-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.copyright {
    font-size: 0.8125rem;
    color: var(--slate-500);
}

.developer-credit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: var(--slate-600);
}

.developer-credit strong {
    color: var(--primary);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.25rem;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-info {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .header-inner {
        height: auto;
        padding: 14px 0;
        flex-direction: column;
        gap: 14px;
    }
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .hero-title {
        font-size: 1.85rem;
    }
    .hero-br {
        display: none;
    }
    .hero-subtitle {
        font-size: 0.95rem;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .search-box {
        flex-direction: column;
        padding: 12px 16px;
        border-radius: var(--radius-lg);
        gap: 10px;
    }
    .search-badge {
        width: 100%;
        text-align: center;
    }
}
