/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 56px);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background: #f8f9fa;
    transition: all 0.3s;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    padding-top: 1rem;
    padding-bottom: 2rem;
    min-height: calc(100vh - 56px);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.stats-card {
    border-left: 4px solid var(--primary-color);
}

.stats-card.success {
    border-left-color: var(--success-color);
}

.stats-card.warning {
    border-left-color: var(--warning-color);
}

.stats-card.danger {
    border-left-color: var(--danger-color);
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
    background-color: #f8f9fa;
}

/* Badges */
.badge-online {
    background-color: var(--success-color);
}

.badge-offline {
    background-color: var(--secondary-color);
}

.badge-warning {
    background-color: var(--warning-color);
}

/* Monitoring Grid */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.student-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background: white;
    transition: all 0.2s;
}

.student-card.online {
    border-left: 4px solid var(--success-color);
}

.student-card.offline {
    border-left: 4px solid var(--secondary-color);
    opacity: 0.7;
}

.student-card.warning {
    border-left: 4px solid var(--warning-color);
    background-color: #fff3cd;
}

.student-card.danger {
    border-left: 4px solid var(--danger-color);
    background-color: #f8d7da;
}

/* Progress Bars */
.progress {
    height: 8px;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 56px);
        transition: left 0.3s;
        z-index: 1000;
    }
    
    .sidebar:not(.collapse) {
        left: 0;
    }
    
    .students-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Arab Font */
.arabic-text {
    font-family: 'Traditional Arabic', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    font-size: 1.2em;
    line-height: 1.8;
}

/* Soal Management Additional Styles */
.soal-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.arabic-preview {
    font-family: 'Traditional Arabic', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    font-size: 1.2em;
    line-height: 1.8;
    padding: 1rem;
    background: white;
    border-radius: 0.375rem;
}

.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    background: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: #0d6efd;
    background: #e7f1ff;
}

.file-upload-area i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.template-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    background: white;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.template-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.template-card.word { border-left: 4px solid #2b579a; }
.template-card.excel { border-left: 4px solid #217346; }
.template-card.pdf { border-left: 4px solid #f40f02; }

.opsi-item {
    position: relative;
    margin-bottom: 0.5rem;
}

.remove-opsi {
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
}

.soal-type-badge {
    font-size: 0.75em;
}

.soal-actions {
    opacity: 1;
    transition: opacity 0.2s;
}

.table-row:hover .soal-actions {
    opacity: 1;
}

/* Preview Modal */
.preview-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.soal-content {
    line-height: 1.6;
}

.soal-content img, .soal-content audio, .soal-content video {
    max-width: 100%;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
}

/* Import Progress */
.import-progress {
    margin-top: 1rem;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Error State */
.error-container {
    text-align: center;
    padding: 3rem 1rem;
}

.error-container i {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 1rem;
}