/* ============ Variables ============ */
:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --secondary: #4CAF50;
    --secondary-dark: #388E3C;
    --accent: #FF9800;
    --teal: #009688;
    --dark: #1a1a1a;
    --dark-light: #2d2d2d;
    --light: #f5f5f5;
    --gray: #757575;
    --border: #e0e0e0;
    --success: #4CAF50;
    --danger: #f44336;
    --warning: #FF9800;
}

/* ============ Base ============ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #333;
    margin: 0;
    background: var(--light);
}

a {
    color: var(--primary);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ============ Layout ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ Header ============ */
.header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

    .logo:hover {
        text-decoration: none;
    }

    .logo img {
        height: 36px;
        width: auto;
    }

.nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .nav a {
        color: rgba(255,255,255,0.85);
        padding: 8px 16px;
        border-radius: 4px;
        transition: all 0.2s;
    }

        .nav a:hover, .nav a.active {
            background: rgba(255,255,255,0.1);
            color: white;
            text-decoration: none;
        }

/* ============ Main Content ============ */
.main {
    flex: 1;
    padding: 30px 0;
}

/* ============ Cards ============ */
.card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--teal);
    font-weight: 600;
}

/* ============ Buttons ============ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .btn:hover {
        text-decoration: none;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-secondary {
    background: var(--gray);
    color: white;
}

    .btn-secondary:hover {
        background: #616161;
    }

.btn-success {
    background: var(--secondary);
    color: white;
}

    .btn-success:hover {
        background: var(--secondary-dark);
    }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--accent);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        margin-bottom: 6px;
        font-weight: 500;
        color: #555;
        font-size: 0.9rem;
    }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    }

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .checkbox-group input {
        width: 18px;
        height: 18px;
        accent-color: var(--primary);
    }

/* ============ Tables ============ */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
}

tr:hover {
    background: #fafafa;
}

/* ============ Stats Grid ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

    .stat-card:nth-child(2) {
        border-left-color: var(--secondary);
    }

    .stat-card:nth-child(3) {
        border-left-color: var(--teal);
    }

    .stat-card:nth-child(4) {
        border-left-color: var(--accent);
    }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ============ Badges ============ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-danger {
    background: #FFEBEE;
    color: #C62828;
}

.badge-info {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-warning {
    background: #FFF3E0;
    color: #E65100;
}

/* ============ Login Page ============ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #2d2d2d 50%, var(--dark) 100%);
}

.login-box {
    background: white;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

    .login-box .logo-img {
        display: block;
        margin: 0 auto 20px;
        height: 60px;
    }

    .login-box h1 {
        text-align: center;
        margin-bottom: 30px;
        color: var(--dark);
        font-size: 1.5rem;
    }

    .login-box .logo-text {
        text-align: center;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--dark);
        margin-bottom: 8px;
    }

/* ============ Download Cards ============ */
.release-card {
    background: white;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

    .release-card.latest {
        border-left-color: var(--secondary);
        background: linear-gradient(135deg, #f1f8e9 0%, white 100%);
    }

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.release-version {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.release-type {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--light);
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
}

.release-meta {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.release-notes {
    background: var(--light);
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    border-left: 3px solid var(--teal);
}

/* ============ Alerts ============ */
.alert {
    padding: 14px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.alert-danger {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #BBDEFB;
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFE0B2;
}

/* ============ Modal ============ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

    .modal-header h2 {
        margin: 0;
        color: var(--teal);
    }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    line-height: 1;
}

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

/* ============ File Size ============ */
.file-size {
    color: var(--gray);
    font-size: 0.85rem;
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

    .empty-state svg {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
        opacity: 0.5;
    }

/* ============ Footer ============ */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

/* ============ Online Status ============ */
.status-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary);
    font-size: 0.85rem;
}

    .status-online::before {
        content: '';
        width: 8px;
        height: 8px;
        background: var(--secondary);
        border-radius: 50%;
    }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}
