/* ATOMIC MEMBERS — Professional SaaS Light Theme — Mobile-First */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f1f5f9; /* Slightly softer gray for app background */
    color: #1e293b;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px; /* Space for fixed bottom nav */
}

/* ====== MOBILE APP UTILITIES ====== */
.app-max-width {
    max-width: 500px;
    margin: 0 auto;
}

.scroll-x {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 4px 16px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

/* ====== LOGIN PAGE ====== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 16px;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: #10b981;
}

.login-logo p {
    color: #64748b;
    font-size: 14px;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 16px; /* prevents iOS zoom */
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.form-group input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    min-height: 100px;
    resize: vertical;
    transition: all 0.2s;
}

.form-group textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #10b981;
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-admin {
    background: #1e293b;
}

.btn-admin:hover {
    background: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
    width: auto;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #059669;
}

/* ====== DASHBOARD HEADER ====== */
.dash-header {
    background: #ffffff;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dash-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.dash-header h2 span {
    color: #10b981;
}

.dash-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #10b981;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.dash-container {
    padding: 20px 20px;
}

.dash-welcome {
    margin-bottom: 28px;
}

.dash-welcome h1 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.dash-welcome p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

/* ====== PRODUCT CARDS (Client) ====== */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px -1px rgba(0,0,0,0.03);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.product-card:hover, .product-card:active {
    transform: scale(0.985);
    box-shadow: 0 2px 8px -1px rgba(0,0,0,0.05);
}

.product-thumb {
    height: 180px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.product-info p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.product-info .content-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.content-tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.tag-video {
    background: #eff6ff;
    color: #2563eb;
}

.tag-pdf {
    background: #fef2f2;
    color: #dc2626;
}

.btn-access {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

/* ====== BOTTOM NAVIGATION ====== */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
}

.nav-item.active {
    color: #10b981;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-download a:hover {
    background: #059669;
}

/* ====== APP COURSE LAYOUT ====== */
.course-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.2);
}

.player-container iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: none;
}

.lesson-info {
    padding: 8px 0;
}

.lesson-info h1 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.lesson-info p {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
}

.playlist-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px -1px rgba(0,0,0,0.03);
}

.playlist-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f8fafc;
    transition: all 0.2s;
}

.playlist-item:active { background: #f1f5f9; }

.playlist-item.active {
    background: #ecfdf5;
    color: #059669;
}

.item-index {
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.playlist-item.active .item-index {
    background: #10b981;
    color: white;
}

.item-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* ====== LOGIN PAGE ====== */
body:has(.login-wrapper) {
    padding-bottom: 0;
    background: #0f172a;
}

/* ====== ADMIN NAV ====== */
.admin-nav {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-nav a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

.admin-nav a:hover, .admin-nav a.active {
    color: #10b981;
}

.admin-nav .nav-brand {
    font-weight: 700;
    color: #0f172a;
    margin-right: auto;
}

/* ====== ADMIN TABLE ====== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.admin-table th {
    text-align: left;
    padding: 14px 16px;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.admin-table td {
    padding: 16px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

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

.admin-table tr:hover {
    background: #f8fafc;
}

.status-active {
    color: #10b981;
    font-weight: 500;
}

.status-blocked {
    color: #ef4444;
    font-weight: 500;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

/* ====== ADMIN FORMS ====== */
.admin-form {
    max-width: 600px;
}

.admin-form .form-group input,
.admin-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.admin-form .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.admin-form .form-group input:focus,
.admin-form .form-group textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-hint {
    color: #64748b;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
}

/* ====== STAT CARDS ====== */
.stat-thumb {
    height: 100px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 32px;
    font-weight: 700;
    color: #cbd5e1;
}

.stat-green { border-color: #a7f3d0; background: #ecfdf5; }
.stat-green .stat-icon { color: #10b981; }
.stat-blue { border-color: #bfdbfe; background: #eff6ff; }
.stat-blue .stat-icon { color: #3b82f6; }
.stat-amber { border-color: #fde68a; background: #fffbeb; }
.stat-amber .stat-icon { color: #f59e0b; }

/* ====== RESPONSIVE — Desktop ====== */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .bottom-nav {
        top: 20px;
        bottom: auto;
        left: auto;
        right: 20px;
        width: 320px;
        height: auto;
        flex-direction: column;
        padding: 20px;
        gap: 10px;
    }
    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 16px;
        width: 100%;
        border-radius: 12px;
        gap: 12px;
    }
    .nav-item span { font-size: 14px; text-transform: none; }
    .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
    .nav-item.active { background: rgba(16, 185, 129, 0.1); }
    
    .dash-container { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    
    .course-layout {
        grid-template-columns: 1fr 340px;
        max-width: 1200px;
        margin: 0 auto;
        align-items: start;
    }
    .playlist-card { position: sticky; top: 100px; }
}

@media (min-width: 1200px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
