/* ======================================================
   MATERI LEARNING SECTION - MODERN UI
   ====================================================== */

/* Container */
.materi-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Section */
.materi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.materi-header h1 {
    font-size: 2rem;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.materi-header h1 i {
    color: #667eea;
    font-size: 2.5rem;
}

.btn-add-materi {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-add-materi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Class Section (Grouped by Class) */
.class-section {
    margin-bottom: 3rem;
}

.class-title {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #667eea;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.class-title i {
    color: #667eea;
}

.materi-count {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: auto;
}

/* Materi Grid */
.materi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Materi Card */
.materi-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.materi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.materi-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.materi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.materi-subject {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
}

.materi-card-body {
    padding: 1.5rem;
    flex: 1;
}

.materi-card-body h3 {
    font-size: 1.25rem;
    color: #2d3748;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
}

.materi-description {
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.materi-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #718096;
}

.materi-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.materi-meta i {
    color: #667eea;
    width: 18px;
}

.materi-card-footer {
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.btn-detail, .btn-edit, .btn-delete-materi {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border: none;
}

.btn-detail {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex: 1;
    justify-content: center;
}

.btn-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-edit {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-edit:hover {
    background: #667eea;
    color: white;
}

.btn-delete-materi {
    background: white;
    color: #e53e3e;
    border: 2px solid #e53e3e;
}

.btn-delete-materi:hover {
    background: #e53e3e;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1.5rem;
}

.empty-state p {
    font-size: 1.125rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.empty-state small {
    color: #718096;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-large {
    max-width: 900px;
}

.modal-small {
    max-width: 400px;
    text-align: center;
    padding: 2rem;
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Form Styles */
.form-materi {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #718096;
    font-size: 0.875rem;
}

.file-info {
    color: #718096;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* File Preview */
.file-preview {
    margin-top: 1rem;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.file-preview-item i {
    font-size: 2rem;
    color: #667eea;
}

.file-preview-item .file-info {
    flex: 1;
    margin: 0;
}

.file-preview-item .file-info strong {
    display: block;
    color: #2d3748;
}

.btn-remove-file {
    background: #fed7d7;
    color: #c53030;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-file:hover {
    background: #fc8181;
    color: white;
}

/* Preview Section */
.preview-section {
    margin: 2rem 0;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.preview-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.preview-subject {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
}

.preview-type {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.preview-card h4 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.preview-desc {
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.preview-content {
    color: #4a5568;
    font-size: 0.875rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.preview-file {
    margin-bottom: 1rem;
}

.preview-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    color: #4a5568;
}

.preview-file-info i {
    color: #667eea;
}

.preview-file-info a {
    color: #667eea;
    text-decoration: none;
}

.preview-meta {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #718096;
}

.preview-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-meta i {
    color: #667eea;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.btn-cancel,
.btn-preview,
.btn-submit,
.btn-cancel-delete,
.btn-confirm-delete {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-cancel:hover {
    background: #cbd5e0;
}

.btn-preview {
    background: #667eea;
    color: white;
}

.btn-preview:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-submit {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.btn-cancel-delete {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-cancel-delete:hover {
    background: #cbd5e0;
}

.btn-confirm-delete {
    background: #e53e3e;
    color: white;
}

.btn-confirm-delete:hover {
    background: #c53030;
}

/* Modal Delete Icon */
.modal-icon-warning {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fed7d7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-icon-warning i {
    font-size: 2.5rem;
    color: #e53e3e;
}

.modal-small h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.5rem;
}

.modal-small p {
    color: #718096;
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .materi-container {
        padding: 1rem;
    }
    
    .materi-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .materi-header h1 {
        font-size: 1.5rem;
    }
    
    .materi-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .materi-card-footer {
        flex-direction: column;
    }
    
    .materi-card-footer .btn-detail {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .materi-header h1 {
        font-size: 1.25rem;
    }
    
    .materi-header h1 i {
        font-size: 1.75rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .form-materi {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.materi-card {
    animation: fadeIn 0.5s ease;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .materi-header,
    .materi-card-footer,
    .btn-add-materi {
        display: none;
    }
    
    .materi-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}