/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Login Page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    color: #333;
    margin-bottom: 0.5rem;
}

.login-form h3 {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-weight: normal;
}

/* Layout */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1rem 1rem;
    border-bottom: 1px solid #34495e;
    margin-bottom: 1rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #34495e;
    color: white;
    border-left: 4px solid #3498db;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

/* Header */
.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Cards dan Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin: 0.5rem 0;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Ujian List */
.ujian-list {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ujian-card {
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.ujian-card h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

/* Demo Account */
.demo-account {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
}

.demo-account p {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Rich Text Editor Styles */
.rich-text-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.5rem;
    cursor: pointer;
    color: #555;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #ddd;
}

.toolbar-btn i {
    font-size: 0.8rem;
}

.editor-content {
    min-height: 200px;
    padding: 1rem;
    outline: none;
}

.editor-content:focus {
    border-color: #3498db;
}

.editor-content ul, .editor-content ol {
    padding-left: 2rem;
}

.editor-content img {
    max-width: 100%;
    height: auto;
}

/* Mini Editor untuk Deskripsi Skor */
.mini-editor .editor-content {
    min-height: 80px;
    font-size: 0.9rem;
}

/* Aspek Penilaian Styles */
.aspek-penilaian-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.aspek-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.aspek-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.aspek-header h5 {
    margin: 0;
    color: #333;
}

.skor-description {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

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

.skor-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.skor-item label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

/* Station Preview */
.station-preview {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Button Styles */
.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Form Group dalam Aspek */
.aspek-item .form-group {
    margin-bottom: 1rem;
}

.aspek-item .form-group:last-child {
    margin-bottom: 0;
}

/* Rich Text Editor Styles - Updated */
.rich-text-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.5rem;
    cursor: pointer;
    color: #555;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #ddd;
}

.toolbar-btn i {
    font-size: 0.8rem;
}

.editor-content {
    min-height: 200px;
    padding: 1rem;
    outline: none;
}

.editor-content:focus {
    border-color: #3498db;
}

.editor-content ul, .editor-content ol {
    padding-left: 2rem;
}

.editor-content img {
    max-width: 100%;
    height: auto;
}

/* Mini Editor untuk Deskripsi Skor */
.mini-editor .editor-content {
    min-height: 80px;
    font-size: 0.9rem;
}

/* Aspek Penilaian Styles - Updated */
.aspek-penilaian-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.aspek-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: move;
    transition: all 0.3s;
}

.aspek-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.aspek-item.dragging {
    opacity: 0.5;
}

.aspek-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.aspek-header h5 {
    margin: 0;
    color: #333;
}

/* Skor Options */
.skor-options {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.skor-description {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

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

.skor-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.skor-item.skor-0 {
    border-left-color: #e74c3c;
}

.skor-item.skor-1 {
    border-left-color: #f39c12;
}

.skor-item.skor-2 {
    border-left-color: #27ae60;
}

.skor-item label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

.skor-item .hint {
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
    display: block;
}

/* Nomor Urut Input */
.nomor-urut {
    width: 80px !important;
}

/* Station Preview */
.station-preview {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Button Styles */
.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Form Group dalam Aspek */
.aspek-item .form-group {
    margin-bottom: 1rem;
}

.aspek-item .form-group:last-child {
    margin-bottom: 0;
}

/* Drag and Drop Hints */
.aspek-item::before {
    content: "≡";
    color: #6c757d;
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .skor-description {
        grid-template-columns: 1fr;
    }
    
    .aspek-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .aspek-header .btn {
        align-self: flex-end;
    }
}

/* Enhanced Rich Text Editor Styles */
.rich-text-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    transition: border-color 0.3s;
}

.rich-text-editor:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    border-radius: 4px 4px 0 0;
}

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.5rem;
    cursor: pointer;
    color: #555;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #ddd;
    color: #333;
}

.toolbar-btn:active {
    background: #dee2e6;
}

.toolbar-btn i {
    font-size: 0.8rem;
}

.editor-content {
    min-height: 150px;
    padding: 1rem;
    outline: none;
    line-height: 1.6;
}

.editor-content:focus {
    outline: none;
}

.editor-content ul, .editor-content ol {
    padding-left: 2rem;
    margin: 0.5rem 0;
}

.editor-content p {
    margin: 0.5rem 0;
}

.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.editor-content a {
    color: #3498db;
    text-decoration: underline;
}

.editor-content a:hover {
    color: #2980b9;
}

/* Specific heights for different editors */
#deskripsiEditor .editor-content {
    min-height: 200px;
}

#instruksiPesertaEditor .editor-content,
#instruksiPengujiEditor .editor-content {
    min-height: 150px;
}

/* Mini Editor untuk Deskripsi Skor */
.mini-editor .editor-content {
    min-height: 100px;
    font-size: 0.9rem;
    padding: 0.75rem;
}

/* Placeholder styling */
.editor-content:empty:before {
    content: attr(data-placeholder);
    color: #6c757d;
    font-style: italic;
}

/* Enhanced drag and drop */
.aspek-item {
    background: white;
    border: 2px dashed transparent;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: move;
    transition: all 0.3s;
    position: relative;
}

.aspek-item:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.aspek-item.dragging {
    opacity: 0.5;
    border-color: #3498db;
    background: #f8f9fa;
}

.aspek-item::before {
    content: "⣿";
    color: #6c757d;
    margin-right: 0.5rem;
    font-size: 1rem;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Form validation styles */
.form-group:has(.editor-content:empty) .rich-text-editor {
    border-color: #e74c3c;
}

.form-group:has(.editor-content:empty) .rich-text-editor:focus-within {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

/* Loading state for form submission */
.form-loading {
    opacity: 0.7;
    pointer-events: none;
}

.form-loading::after {
    content: "Menyimpan...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    z-index: 1000;
}
/* Enhanced Aspek Penilaian Styles */
.aspek-penilaian-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.aspek-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.aspek-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.aspek-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.aspek-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Skor Badges */
.skor-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.skor-0-badge {
    background: #e74c3c;
    color: white;
}

.skor-1-badge {
    background: #f39c12;
    color: white;
}

.skor-2-badge {
    background: #27ae60;
    color: white;
}

/* Checkbox Group Enhancement */
.checkbox-group {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

/* Form Hints */
.form-hint {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
    font-style: italic;
}

/* Skor Description Grid */
.skor-description {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

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

.skor-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    transition: all 0.3s;
}

.skor-item.skor-0 {
    border-left-color: #e74c3c;
}

.skor-item.skor-1 {
    border-left-color: #f39c12;
}

.skor-item.skor-2 {
    border-left-color: #27ae60;
}

.skor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Aspek Actions */
.aspek-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.duplicate-aspek {
    background: #17a2b8;
    border-color: #17a2b8;
}

.duplicate-aspek:hover {
    background: #138496;
    border-color: #138496;
}

/* Tambah Aspek Button */
#tambahAspek {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s;
}

#tambahAspek:disabled {
    cursor: not-allowed;
}

#tambahAspek:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Nomor Urut Input */
.nomor-urut {
    width: 80px !important;
    text-align: center;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aspek-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .aspek-header .btn {
        align-self: stretch;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .skor-description {
        grid-template-columns: 1fr;
    }
    
    .aspek-actions {
        flex-direction: column;
    }
}

/* Animation for new aspek */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aspek-item.new-aspek {
    animation: slideIn 0.3s ease-out;
}

/* Scrollable container for many aspeks */
#aspekContainer {
    max-height: 800px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#aspekContainer::-webkit-scrollbar {
    width: 6px;
}

#aspekContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#aspekContainer::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#aspekContainer::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}