/* Materi Container */
.materi-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.materi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.materi-header h1 {
    font-size: 28px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Class Section (untuk guru) */
.class-section {
    margin-bottom: 40px;
}

.class-title {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.materi-count {
    font-size: 14px;
    color: #95a5a6;
    font-weight: normal;
    margin-left: auto;
}

.btn-add-materi {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.btn-add-materi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Materi Grid */
.materi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.materi-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.materi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.materi-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.materi-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.materi-subject {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.materi-card-body {
    padding: 20px;
}

.materi-card-body h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.materi-description {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.materi-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #95a5a6;
}

.materi-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.materi-card-footer {
    padding: 15px 20px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-detail {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-detail:hover {
    background: #2980b9;
}

.btn-delete-materi {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-delete-materi:hover {
    background: #c0392b;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state small {
    font-size: 14px;
    color: #bdc3c7;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-small {
    max-width: 400px;
    text-align: center;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #2c3e50;
}

.form-materi {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #95a5a6;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel,
.btn-cancel-delete {
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-cancel:hover,
.btn-cancel-delete:hover {
    background: #bdc3c7;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
}

.btn-confirm-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-confirm-delete:hover {
    background: #c0392b;
}

.modal-icon-warning {
    width: 80px;
    height: 80px;
    background: #fff3cd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    font-size: 40px;
    color: #f39c12;
}

.modal-small h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.modal-small p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .materi-grid {
        grid-template-columns: 1fr;
    }
    
    .materi-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}


/* Modal Large */
.modal-large {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* File Upload Styling */
.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.form-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.file-info {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

/* File Preview */
.file-preview {
    margin-top: 15px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
    margin-top: 10px;
}

.file-preview-item i {
    font-size: 32px;
    color: #667eea;
}

.file-preview-item .file-info {
    flex: 1;
    margin: 0;
}

.file-preview-item .file-info strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
}

.file-preview-item .file-info span {
    color: #7f8c8d;
    font-size: 13px;
}

.btn-remove-file {
    background: #e74c3c;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove-file:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.preview-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-section h3 i {
    color: #667eea;
}

.preview-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #ecf0f1;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-subject {
    background: #667eea;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.preview-type {
    background: #3498db;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.preview-card h4 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 10px;
}

.preview-desc {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.6;
}

.preview-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    color: #2c3e50;
    line-height: 1.8;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.preview-file {
    margin-bottom: 15px;
}

.preview-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.preview-file-info i {
    color: #667eea;
    font-size: 18px;
}

.preview-file-info a {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
}

.preview-file-info a:hover {
    text-decoration: underline;
}

.preview-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.preview-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Button Preview */
.btn-preview {
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-preview:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-large {
        max-width: 95%;
        margin: 20px;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}


/* Button Edit */
.btn-edit {
    background: #f39c12;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.materi-card-footer {
    display: flex;
    gap: 10px;
    align-items: center;
}

.materi-card-footer .btn-detail {
    flex: 1;
}

.materi-card-footer .btn-edit,
.materi-card-footer .btn-delete-materi {
    flex-shrink: 0;
}
