/* ============================================ */
/* Custom Styles for YemAcademy */
/* ============================================ */

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Navbar Enhancements */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.post-card {
    height: 100%;
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.post-card:hover::before {
    transform: scaleX(1);
}

.card-img-top {
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Badges */
.badge {
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Forms */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-floating > label {
    color: var(--text-secondary);
}

/* Hero Section - Flow (not fixed) */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    border-radius: 0;
    padding: 2.5rem 0;
    color: white;
    position: relative;
    top: auto;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        position: relative;
        top: 0;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-section > * {
    position: relative;
    z-index: 1;
}

/* Spacer that preserves layout under fixed hero */
#hero-spacer {
    height: 0px; /* will be set dynamically via JS */
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #111827 100%);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-badge:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: 10px;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border-left: 4px solid var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1.5rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .card-img-top {
        height: 180px;
    }
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea {
    transition: all 0.3s ease;
}

/* Line clamp helpers */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

/* Hero extras */
.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
}

.hero-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --light-bg: #0f172a;
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

/* Featured strip */
.featured-strip .horizontal-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.featured-strip .horizontal-scroll .horizontal-item {
    flex: 0 0 auto;
    width: 280px;
    scroll-snap-align: start;
}

.featured-strip .horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.featured-card {
    min-width: 0;
}

.profile-summary {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.profile-banner {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
}

.profile-summary .badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
}

.profile-summary .card-body {
    padding-top: 90px;
}

.profile-avatar {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.profile-avatar img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.profile-avatar-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 54px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.profile-stat {
    padding: 16px 0;
}

.profile-stat .value {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.profile-stat .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-chip i {
    color: var(--primary-color);
}

[data-theme="dark"] .badge-chip,
body[data-theme="dark"] .badge-chip {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    color: #e5e7eb;
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .badge-chip i,
body[data-theme="dark"] .badge-chip i {
    color: #c7d2fe;
}

[data-theme="dark"] .profile-summary,
body[data-theme="dark"] .profile-summary {
    background: #111827;
    color: #e5e7eb;
}

[data-theme="dark"] .profile-banner,
body[data-theme="dark"] .profile-banner {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

[data-theme="dark"] .profile-stat .label,
body[data-theme="dark"] .profile-stat .label {
    color: #94a3b8;
}

[data-theme="dark"] .course-card,
body[data-theme="dark"] .course-card {
    background: #111827;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .alert,
body[data-theme="dark"] .alert {
    color: #e5e7eb;
}

.site-footer {
    background: linear-gradient(135deg, var(--dark-bg), #0f172a);
}

.site-footer .footer-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
}

.site-footer .footer-brand i {
    font-size: 1.6rem;
}

.footer-links li + li {
    margin-top: 0.5rem;
}

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

.footer-links a:hover {
    color: #ffffff;
}

.footer-newsletter .form-control {
    border-radius: 14px 0 0 14px;
}

.footer-newsletter .btn {
    border-radius: 0 14px 14px 0;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    margin-right: 8px;
    transition: background 0.2s ease;
}

.footer-social a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-meta-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-left: 16px;
}

.footer-meta-links a:hover {
    color: #ffffff;
}

[data-theme="dark"] .site-footer,
body[data-theme="dark"] .site-footer {
    background: linear-gradient(135deg, #0b1220, #10162d);
}

[data-theme="dark"] .footer-links a,
body[data-theme="dark"] .footer-links a,
[data-theme="dark"] .footer-meta-links a,
body[data-theme="dark"] .footer-meta-links a {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .footer-links a:hover,
body[data-theme="dark"] .footer-links a:hover,
[data-theme="dark"] .footer-meta-links a:hover,
body[data-theme="dark"] .footer-meta-links a:hover {
    color: #ffffff;
}

[data-theme="dark"] .footer-newsletter .form-control,
body[data-theme="dark"] .footer-newsletter .form-control {
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="dark"] .footer-social a,
body[data-theme="dark"] .footer-social a {
    background: rgba(148, 163, 184, 0.2);
}

.course-card .badge {
    font-size: 11px;
}

.course-card .progress {
    background-color: rgba(99, 102, 241, 0.1);
}

.course-card .progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.profile-form .form-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-form .form-control {
    padding: 0.65rem 1rem;
    border-radius: 12px;
}

.profile-form .col-md-6,
.profile-form .col-12 {
    display: flex;
    flex-direction: column;
}

.profile-form .col-md-6 .invalid-feedback,
.profile-form .col-12 .invalid-feedback {
    margin-top: 6px;
}

.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

.badge-chip i {
    color: var(--primary-color);
}

.profile-form textarea.form-control {
    min-height: 160px;
}

.featured-card .card-img-top {
    height: 160px;
    object-fit: cover;
}

[data-theme="dark"] body,
body[data-theme="dark"] {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .navbar,
body[data-theme="dark"] .navbar {
    background-color: rgba(17, 24, 39, 0.85) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .card,
body[data-theme="dark"] .card {
    background: #111827;
    color: var(--text-primary);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .bg-secondary.text-white,
body[data-theme="dark"] .bg-secondary.text-white {
    background-color: #1f2937 !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select {
    background-color: #0b1220;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .input-group-text,
body[data-theme="dark"] .input-group-text {
    background-color: #0b1220;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .page-link,
body[data-theme="dark"] .page-link {
    color: #c7d2fe;
}

[data-theme="dark"] .badge.bg-light.text-dark,
body[data-theme="dark"] .badge.bg-light.text-dark {
    background: #0b1220 !important;
    color: var(--text-primary) !important;
}

