/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Light Palette */
    --primary: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.2);

    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    /* Pure White */

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    --border: 1px solid #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 0;
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

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

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Components */
.glass-card {
    background: var(--bg-card);
    border: var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: 2rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Navbar */
nav {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    /* Slightly tighter radius */
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--primary-glow);
    transition: all 0.2s;
    font-size: 1rem;
}

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

#auth-btn {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

#auth-btn:hover {
    opacity: 0.9;
}

/* Forms */
input,
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Course Cards */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.course-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    /* Lighter border */
}

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

.course-thumb {
    height: 200px;
    background-color: #f1f5f9;
    background-size: cover;
    background-position: center;
}

.course-content {
    padding: 1.5rem;
}

.price-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

/* Footer */
footer {
    border-top: var(--border);
    padding: 4rem 0;
    background: white;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Admin Tables (New) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft {
    background: #f1f5f9;
    color: var(--text-muted);
}


/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: var(--border);
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Icon Buttons */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}


/* Admin Navigation */
.admin-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-nav .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.admin-nav .nav-links {
    display: flex;
    gap: 0.5rem;
    background: rgba(241, 245, 249, 0.5);
    padding: 0.3rem;
    border-radius: 99px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.admin-nav .nav-links a {
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-nav .nav-links a:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.admin-nav .nav-links a.active {
    background: white;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-main);
}

/* Admin Footer */
.admin-footer {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: var(--border);
    margin-top: auto;
    background: white;
}

/* Module Grid Layout */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.module-card-new {
    background: white;
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.module-card-new:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-glow);
}

.module-card-new h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.module-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.module-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}