/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1f2937;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-list a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.nav-list a:hover {
    background-color: #f3f4f6;
}

.nav-list .welcome {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 1rem;
}

.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.flash-message.success {
    background-color: #d1fae5;
    color: #065f46;
}
.flash-message.danger {
    background-color: #fee2e2;
    color: #991b1b;
}
.flash-message.warning {
    background-color: #fef3c7;
    color: #92400e;
}
.flash-message.info {
    background-color: #e0e7ff;
    color: #3730a3;
}

/* Footer */
.site-footer {
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
}

.site-footer p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Hero section */
.hero {
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    padding: 4rem 0 3rem;
    text-align: center;
    border-radius: 0.75rem;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1e3a8a;
    font-weight: 700;
}

.hero p {
    font-size: 1.125rem;
    color: #374151;
    max-width: 600px;
    margin: 0.5rem auto 2rem;
}

.hero .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.hero .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.hero .btn-primary {
    background-color: #4f46e5;
    color: #ffffff;
}

.hero .btn-primary:hover {
    background-color: #4338ca;
}

.hero .btn-secondary {
    background-color: #ffffff;
    border: 1px solid #4f46e5;
    color: #4f46e5;
}

.hero .btn-secondary:hover {
    background-color: #f3f4f6;
}

/* Courses grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.course-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.course-card .card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.admin-course-thumb {
    width: 72px;
    height: 44px;
    object-fit: cover;
    border-radius: 0.375rem;
    display: block;
}

.course-card .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.course-card .tag {
    font-size: 0.75rem;
    background-color: #eef2ff;
    color: #4f46e5;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.course-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.course-card p.description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #6b7280;
    height: 60px;
    overflow: hidden;
}

.course-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.course-card .price {
    font-weight: 600;
    color: #1f2937;
}

.course-card .btn-learn {
    display: inline-block;
    margin-top: auto;
    padding: 0.5rem 1rem;
    background-color: #4f46e5;
    color: white;
    border-radius: 0.375rem;
    text-align: center;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2rem;
    color: #111827;
    font-weight: 500;
    text-decoration: none;
}

.back-link:hover {
    color: #4f46e5;
}

.course-hero-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 3rem;
    align-items: start;
    margin-bottom: 3rem;
}

.course-hero-copy {
    padding-top: 0.25rem;
}

.category-pill {
    display: inline-flex;
    padding: 0.35rem 0.8rem;
    background-color: #0ea5e9;
    color: #ffffff;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.course-hero-copy h1 {
    max-width: 820px;
    font-size: 2.8rem;
    line-height: 1.08;
    margin-bottom: 1.25rem;
    color: #111827;
}

.course-hero-copy > p {
    max-width: 760px;
    color: #6b7280;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.course-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.detail-instructor {
    color: #111827;
    font-size: 1rem;
}

.enroll-panel {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
}

.enroll-panel img {
    width: 100%;
    height: 165px;
    object-fit: cover;
    border-radius: 0.6rem;
    display: block;
    margin-bottom: 1.25rem;
}

.enroll-price {
    font-size: 2rem;
    line-height: 1;
    color: #111827;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.coupon-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.coupon-row input,
.coupon-row button {
    height: 42px;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    background-color: #ffffff;
    font-size: 0.95rem;
}

.coupon-row input {
    padding: 0 0.8rem;
}

.coupon-row button {
    cursor: pointer;
    font-weight: 800;
    color: #111827;
}

.enroll-button {
    width: 100%;
    border: 0;
    cursor: pointer;
    background-color: #0ea5e9;
    padding: 0.85rem 1rem;
    font-size: 1rem;
}

.course-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 3rem;
    align-items: start;
}

.detail-section {
    margin-bottom: 3rem;
}

.detail-section h2,
.side-panel h2 {
    font-size: 1.45rem;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: #111827;
}

.learn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 2rem;
    list-style: none;
}

.learn-grid li {
    position: relative;
    padding-left: 1.7rem;
    font-size: 1rem;
    color: #111827;
}

.learn-grid li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid #22c55e;
    border-radius: 9999px;
}

.learn-grid li::after {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.42rem;
    width: 0.32rem;
    height: 0.16rem;
    border-left: 2px solid #22c55e;
    border-bottom: 2px solid #22c55e;
    transform: rotate(-45deg);
}

.about-copy,
.muted-text {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.8;
}

.about-instructor {
    margin-top: 1.5rem;
}

.about-instructor h3 {
    margin-bottom: 0.5rem;
}

.about-instructor p {
    color: #6b7280;
    line-height: 1.7;
}

.course-detail-side {
    display: grid;
    gap: 1.5rem;
}

.side-panel {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    background-color: #ffffff;
}

.side-panel ul {
    padding-left: 1.25rem;
    color: #6b7280;
    display: grid;
    gap: 0.9rem;
}

.side-panel li::marker {
    color: #0ea5e9;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.tech-tags span {
    background-color: #f1f5f9;
    color: #111827;
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.course-card .btn-learn:hover {
    background-color: #4338ca;
}

/* Feature cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    text-align: center;
}

.feature-card .icon {
    font-size: 2rem;
    color: #4f46e5;
    margin-bottom: 0.75rem;
}

.feature-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Call to action */
.cta-section {
    background: linear-gradient(90deg, #4f46e5 0%, #3b82f6 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 0.75rem;
    text-align: center;
    margin-bottom: 3rem;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.cta-section p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: #e0e7ff;
}

.cta-section .btn-cta {
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    color: #4f46e5;
    border-radius: 0.375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}

.cta-section .btn-cta:hover {
    background-color: #e5e7eb;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.form-group textarea {
    resize: vertical;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: auto;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.repeatable-list {
    display: grid;
    gap: 0.5rem;
}

.repeatable-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border: 0;
    cursor: pointer;
}

.course-form-preview {
    width: 180px;
    height: 100px;
    object-fit: cover;
    display: block;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.course-detail-section {
    margin-bottom: 1.5rem;
}

.course-detail-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.detail-list {
    display: grid;
    gap: 0.5rem;
    padding-left: 1.25rem;
    color: #4b5563;
}

.instructor-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
}

.instructor-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.instructor-card p {
    font-size: 0.85rem;
    color: #6b7280;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

/* Admin styles */
.admin-container {
    display: flex;
    min-height: 80vh;
}

.admin-sidebar {
    width: 220px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    padding: 1rem;
    height: 100%;
}

.admin-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
}

.admin-sidebar li {
    margin-bottom: 0.75rem;
}

.admin-sidebar a {
    text-decoration: none;
    color: #374151;
    padding: 0.5rem;
    display: block;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.admin-sidebar a:hover,
.admin-sidebar .active {
    background-color: #eef2ff;
    color: #4f46e5;
}

.admin-content {
    flex: 1;
    padding: 1rem 2rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table thead {
    background-color: #f9fafb;
}

.table th, .table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    color: #374151;
}

.table td {
    color: #4b5563;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions form {
    display: inline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-suspended {
    background-color: #fee2e2;
    color: #991b1b;
}

@media (max-width: 900px) {
    .course-hero-detail,
    .course-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .enroll-panel,
    .course-detail-side {
        max-width: 520px;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .course-hero-copy h1 {
        font-size: 2.1rem;
    }

    .learn-grid {
        grid-template-columns: 1fr;
    }

    .coupon-row {
        grid-template-columns: 1fr;
    }
}

/* Lesson list */
.lesson-list {
    margin-top: 1rem;
}

.lesson-item {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-item h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.lesson-item p {
    font-size: 0.8rem;
    color: #6b7280;
}
