﻿
:root {
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(226, 232, 240, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-soft: rgba(79, 70, 229, 0.08);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --accent: #06b6d4;
    --accent-soft: rgba(6, 182, 212, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --radius: 20px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.25s ease;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --cyan: #0891b2;
    --cyan-soft: #ecfeff;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --purple: #7c3aed;
    --purple-soft: #f5f3ff;
    --main-bg: #f5f7fb;
    --card: #ffffff;
    --soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 6px 20px rgba(15, 23, 42, .045);
    --shadow-hover: 0 12px 30px rgba(15, 23, 42, .08);
    --radius: 18px;
    --radius-md: 13px;
    --transition: .22s ease;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}


.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1150px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* Sidebar Navigation */
aside.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /*height: calc(100vh - 48px);*/
    position: sticky;
    top: 24px;
}

.brand {
    display: flex;
    flex-direction:column;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.15rem;
    margin-bottom: 28px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
}

    .nav-item:hover, .nav-item.active {
        background: var(--primary-soft);
        color: var(--primary);
    }

.theme-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    width: 100%;
}

main.single-column-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* آمار جدید ۴گانه */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}
    .stat-card span {
        font-size: 0.75rem;
        color: var(--text-muted);
    }
    .stat-card p {
        font-size: 1.1rem;
        font-weight: bold;
        color:rgba(16, 15, 15,0.8);
    }
    .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

.hero-download {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.08));
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.badge {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
}

.badge-paid {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-free {
    background: var(--success-soft);
    color: var(--success);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

    .btn-download:hover {
        background: #4338ca;
        transform: translateY(-2px);
    }

.section-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 12px 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 850px) {
    .layout {
        grid-template-columns: 1fr;
    }

    aside.sidebar {
        height: auto;
        position: relative;
        top: 0;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .nav-item {
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .download-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-download {
        width: 100%;
    }
}
/* =========================================================
                       APP
                       ========================================================= */
.app {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 30px 40px;
}

/* =========================================================
                       HEADER
                       ========================================================= */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.logo {
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--text);
}

    .logo span {
        color: var(--primary);
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 200px;
}

    .search-box input {
        width: 100%;
        padding: 8px 16px 8px 38px;
        border-radius: 30px;
        border: 1px solid var(--border);
        background: var(--card);
        color: var(--text);
        outline: none;
        font-size: .78rem;
        transition: var(--transition);
    }

        .search-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
        }

        .search-box input::placeholder {
            color: var(--light);
        }

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .5;
    font-size: .85rem;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .theme-toggle:hover {
        border-color: var(--primary);
        background: var(--primary-soft);
    }

/* =========================================================
                       PAGE HEADER
                       ========================================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

    .page-header h1 {
        font-size: clamp(1.5rem, 2.5vw, 2rem);
        font-weight: 900;
    }

        .page-header h1 span {
            color: var(--primary);
        }

    .page-header p {
        color: var(--muted);
        font-size: .85rem;
    }

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 18px;
    border-radius: 30px;
    background: var(--card);
    border: 1px solid var(--border);
    font-size: .7rem;
    font-weight: 700;
    color: var(--muted);
    transition: var(--transition);
    cursor: pointer;
}

    .filter-tab.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    .filter-tab:hover:not(.active) {
        border-color: var(--primary);
        color: var(--text);
    }

/* =========================================================
                       COURSE GRID
                       ========================================================= */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.course-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

    .course-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }

/* =========================================================
                       COURSE IMAGE
                       ========================================================= */
.course-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--soft);
    overflow: hidden;
}

    .course-image-wrap img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .4s ease;
    }

.course-card:hover .course-image-wrap img {
    transform: scale(1.03);
}

.course-badges-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.course-badge {
    font-size: .52rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 30px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

    .course-badge.free {
        background: rgba(8, 145, 178, .92);
        color: #fff;
        border: 1px solid rgba(255,255,255,.15);
    }

    .course-badge.popular {
        background: rgba(217, 119, 6, .92);
        color: #fff;
        border: 1px solid rgba(255,255,255,.15);
    }

    .course-badge.new {
        background: rgba(22, 163, 74, .92);
        color: #fff;
        border: 1px solid rgba(255,255,255,.15);
    }

    .course-badge.premium {
        background: rgba(124, 58, 237, .92);
        color: #fff;
        border: 1px solid rgba(255,255,255,.15);
    }

/* =========================================================
                       COURSE CONTENT
                       ========================================================= */
.course-content {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-card h3 {
    font-size: .95rem;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.4;
    padding-bottom: 8px;
}

.course-card .desc {
    color: var(--muted);
    font-size: .7rem;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: .6rem;
    color: var(--light);
    padding: 10px 0;
    border-top: 1px solid var(--border);
    /*border-bottom: 1px solid var(--border);*/
    margin-bottom: 14px;
}

    .course-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }

.course-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

    .course-actions .btn {
        flex: 1;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: .65rem;
        font-weight: 700;
        text-align: center;
        transition: var(--transition);
    }

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

/* =========================================================
                       FOOTER
                       ========================================================= */
.footer {
    text-align: center;
    color: var(--light);
    padding: 30px 18px 10px;
    font-size: .55rem;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

/* =========================================================
                       EMPTY STATE
                       ========================================================= */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

    .empty-state .empty-icon {
        font-size: 3rem;
        margin-bottom: 12px;
    }

    .empty-state h3 {
        font-size: 1.2rem;
        color: var(--text);
        margin-bottom: 6px;
    }

/* =========================================================
                       RESPONSIVE
                       ========================================================= */
@media(max-width:768px) {
    .app {
        padding: 16px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-actions {
        justify-content: space-between;
    }

    .search-box {
        min-width: unset;
        flex: 1;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:400px) {
    .app {
        padding: 10px;
    }

    .course-content {
        padding: 12px 14px 14px;
    }

    .course-actions {
        flex-direction: column;
    }

    .filter-tabs {
        gap: 5px;
    }

    .filter-tab {
        padding: 4px 12px;
        font-size: .62rem;
    }
}
/* =========================================================
           MAIN CARD
           ========================================================= */
.main-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

    .main-card:hover {
        box-shadow: var(--shadow-hover);
    }

/* =========================================================
           HEADER SECTION
           ========================================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

    .section-header h2 {
        font-size: 1.4rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .section-header h2 i {
            color: var(--primary);
        }

.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 200px;
}

    .search-box input {
        width: 100%;
        padding: 9px 16px 9px 40px;
        border-radius: 12px;
        border: 1px solid var(--card-border);
        background: var(--bg);
        color: var(--text-main);
        font-size: 0.85rem;
        outline: none;
        transition: var(--transition);
    }

        .search-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-soft);
        }

        .search-box input::placeholder {
            color: var(--text-muted);
        }

    .search-box .search-icon {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 0.9rem;
    }

.filter-btn {
    padding: 9px 18px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .filter-btn:hover {
        border-color: var(--primary);
        color: var(--text-main);
    }

    .filter-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

/* =========================================================
           STATS ROW
           ========================================================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-item {
    background: var(--bg);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid var(--card-border);
}

    .stat-item .stat-label {
        font-size: 0.7rem;
        color: var(--text-muted);
        font-weight: 500;
    }

    .stat-item .stat-value {
        font-size: 1.25rem;
        font-weight: 700;
        margin-top: 2px;
    }

        .stat-item .stat-value.green {
            color: var(--success);
        }

        .stat-item .stat-value.blue {
            color: var(--primary);
        }

        .stat-item .stat-value.gold {
            color: var(--warning);
        }

/* =========================================================
           TABLE
           ========================================================= */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.85rem;
}

thead th {
    padding: 14px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--card-border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

    tbody tr:hover {
        background: var(--primary-soft);
    }

    tbody tr:last-child td {
        border-bottom: none;
    }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

    .status-badge.success {
        background: var(--success-soft);
        color: var(--success);
    }

    .status-badge.pending {
        background: var(--warning-soft);
        color: var(--warning);
    }

    .status-badge.failed {
        background: var(--danger-soft);
        color: var(--danger);
    }

    .status-badge .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        display: inline-block;
    }

    .status-badge.success .dot {
        background: var(--success);
    }

    .status-badge.pending .dot {
        background: var(--warning);
    }

    .status-badge.failed .dot {
        background: var(--danger);
    }

.tracking-code {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--primary);
    font-family: monospace;
}

.course-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .course-name .course-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: var(--primary-soft);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

.price-amount {
    font-weight: 700;
}

/* =========================================================
           FOOTER
           ========================================================= */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 12px;
}

    .table-footer .info {
        font-size: 0.78rem;
        color: var(--text-muted);
    }

.pagination {
    display: flex;
    gap: 4px;
}

    .pagination button {
        padding: 6px 14px;
        border-radius: 8px;
        background: transparent;
        color: var(--text-muted);
        font-size: 0.8rem;
        font-weight: 500;
        transition: var(--transition);
        border: 1px solid transparent;
    }

        .pagination button:hover {
            background: var(--primary-soft);
            color: var(--primary);
        }

        .pagination button.active {
            background: var(--primary);
            color: white;
        }

/* =========================================================
           MOBILE RESPONSIVE
           ========================================================= */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .main-card {
        padding: 18px 14px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-actions {
        flex-direction: column;
    }

    .search-box {
        min-width: unset;
        width: 100%;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-item {
        padding: 12px 14px;
    }

        .stat-item .stat-value {
            font-size: 1rem;
        }

    table {
        font-size: 0.78rem;
    }

    thead th,
    tbody td {
        padding: 10px 10px;
    }

    .course-name .course-icon {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .table-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pagination {
        justify-content: center;
    }

    .tracking-code {
        font-size: 0.7rem;
    }

    .status-badge {
        font-size: 0.62rem;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: space-between;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .main-card {
        padding: 14px 10px;
    }

    thead th,
    tbody td {
        padding: 8px 6px;
        font-size: 0.7rem;
    }

    .price-amount {
        font-size: 0.7rem;
    }
}

/* =========================================================
           SCROLLBAR
           ========================================================= */
.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 10px;
}

    .table-wrapper::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }