/* Reset and 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: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-brand i {
    margin-right: 10px;
    color: #ffd700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* User Info */
.user-info {
    background: #e8f4fd;
    padding: 10px 0;
    margin-top: 80px;
    border-bottom: 1px solid #ddd;
}

.user-info p {
    margin: 0;
    color: #2c3e50;
    font-weight: 500;
}

/* Main Content */
main {
    margin-top: 80px;
}

.section {
    display: none;
    min-height: calc(100vh - 80px);
}

.section.active {
    display: block;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeInUp 1s ease 0.4s both;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ffd700;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-icon {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-delete i {
    font-size: 0.8rem;
}

/* Enhanced Modal Styles */
.enhanced-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.enhanced-modal-content {
    padding: 2rem;
}

/* Rich Text Editor */
.rich-editor {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.editor-toolbar {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 5px;
    padding-right: 10px;
    border-right: 1px solid #ddd;
    margin-right: 10px;
}

.toolbar-group:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.editor-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.editor-btn:hover {
    background: #e9ecef;
}

.editor-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.rich-text-editor {
    min-height: 150px;
    padding: 15px;
    outline: none;
    line-height: 1.6;
}

.rich-text-editor:empty:before {
    content: attr(placeholder);
    color: #999;
}

/* Image Upload Area */
.image-upload-area,
.attachment-upload-area {
    margin-top: 10px;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-zone i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.upload-zone p {
    color: #666;
    margin: 0;
}

/* Image Preview */
.image-preview-container,
.attachment-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.attachment-preview-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.attachment-preview-item .file-info {
    flex: 1;
}

.attachment-preview-item .file-name {
    font-weight: 500;
    color: #2c3e50;
}

.attachment-preview-item .file-size {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Table in Rich Editor */
.rich-text-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

.rich-text-editor table th,
.rich-text-editor table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.rich-text-editor table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Important Notes */
.important-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.important-note .note-icon {
    color: #f39c12;
    margin-right: 10px;
}

.important-note .note-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: 5px;
}

.important-note .note-content {
    color: #856404;
}

/* Step by Step Guide */
.step-by-step {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.step-by-step .step-icon {
    color: #28a745;
    margin-right: 10px;
}

.step-by-step .step-title {
    font-weight: 600;
    color: #155724;
    margin-bottom: 10px;
}

.step-by-step .step-list {
    color: #155724;
    margin: 0;
    padding-left: 20px;
}

.step-by-step .step-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Math Formula */
.math-formula {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.math-formula .formula-icon {
    color: #007bff;
    margin-right: 10px;
}

.math-formula .formula-title {
    font-weight: 600;
    color: #004085;
    margin-bottom: 10px;
}

.math-formula .formula-content {
    color: #004085;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #b3d9ff;
    text-align: center;
}

/* Code Block */
.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 4px solid #6c757d;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.code-block .code-icon {
    color: #6c757d;
    margin-right: 10px;
}

.code-block .code-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.code-block .code-content {
    color: #495057;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #ffffff;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    overflow-x: auto;
    white-space: pre-wrap;
    margin: 0;
}

/* Enhanced Table Styling */
.rich-text-editor .tugas-table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.rich-text-editor .tugas-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border: none;
}

.rich-text-editor .tugas-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
}

.rich-text-editor .tugas-table td:last-child {
    border-right: none;
}

.rich-text-editor .tugas-table tr:last-child td {
    border-bottom: none;
}

.rich-text-editor .tugas-table tr:nth-child(even) {
    background: #f8f9fa;
}

.rich-text-editor .tugas-table tr:hover {
    background: #e8f4fd;
}

/* Form Row and Columns */
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-column {
    display: flex;
    flex-direction: column;
}

.form-column label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.content-section {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-zone.small {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    margin-bottom: 10px;
}

.upload-zone.small:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-zone.small i {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 5px;
}

.upload-zone.small p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.content-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
}

.content-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.content-btn i {
    font-size: 1.2rem;
}

.preview-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-text {
    color: #6c757d;
    font-size: 0.8rem;
    text-align: center;
    font-style: italic;
    margin: 0;
}

.preview-container .image-preview-item {
    width: 60px;
    height: 60px;
    margin: 2px;
}

.preview-container .attachment-preview-item {
    padding: 8px;
    font-size: 0.8rem;
}

.preview-container .attachment-preview-item .file-name {
    font-size: 0.75rem;
}

.preview-container .attachment-preview-item .file-size {
    font-size: 0.7rem;
}

/* Responsive for form columns */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .content-section {
        min-height: 120px;
    }
}

/* Section Content */
.section-content {
    padding: 60px 0;
    min-height: calc(100vh - 80px);
}

.section-content h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

/* Kelas Section */
#kelas {
    padding: 60px 0;
}

#kelas h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.kelas-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    background: white;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.kelas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.kelas-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border-left: 5px solid #667eea;
}

.kelas-card:hover {
    transform: translateY(-5px);
}

.kelas-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.kelas-info {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #6c757d;
}

.kelas-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Detail Kelas Styles */
.kelas-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.btn-back {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-back i {
    font-size: 0.8rem;
}

#kelasTitle {
    color: #2c3e50;
    margin: 0;
}

/* Materi Section */
.materi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.materi-header h3 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.materi-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.materi-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.materi-item:hover {
    background: #f8f9fa;
}

.materi-item:last-child {
    border-bottom: none;
}

.materi-icon {
    margin-right: 1rem;
    font-size: 2rem;
    color: #e74c3c;
}

.materi-info {
    flex: 1;
}

.materi-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.materi-info p {
    color: #6c757d;
    font-size: 0.9rem;
}

.materi-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tugas Section */
.tugas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tugas-header h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin: 0;
}

.tugas-header .btn-primary {
    white-space: nowrap;
}

.tugas-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.tugas-item:hover {
    background: #f8f9fa;
}

.tugas-item:last-child {
    border-bottom: none;
}

.tugas-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tugas-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.completed {
    background: #d4edda;
    color: #155724;
}

/* Absensi Section */
#absensi {
    padding: 60px 0;
}

#absensi h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.absensi-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: #2c3e50;
}

.control-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.absensi-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-top: 4px solid #667eea;
}

.stat-card h3 {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

/* ESP32 Status */
.esp32-status {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.esp32-status h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.device-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: #28a745;
}

.status-indicator.offline {
    background: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.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);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: rgba(102, 126, 234, 0.95);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        backdrop-filter: blur(10px);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
    }
    
    .kelas-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 12px 20px;
    }
    
    .kelas-grid {
        grid-template-columns: 1fr;
    }
    
    .absensi-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .absensi-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .materi-item,
    .tugas-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .materi-actions,
    .tugas-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .device-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .absensi-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Tugas Detail Styles */
.tugas-detail-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tugas-detail-content {
    display: grid;
    gap: 2rem;
}

.tugas-info-card,
.tugas-description-card,
.tugas-files-card,
.tugas-submission-card,
.tugas-history-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tugas-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.tugas-description-card h3,
.tugas-files-card h3,
.tugas-submission-card h3,
.tugas-history-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tugas-description-card h3 i,
.tugas-files-card h3 i,
.tugas-submission-card h3 i,
.tugas-history-card h3 i {
    color: #667eea;
}

.file-list {
    display: grid;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
}

.file-icon {
    margin-right: 1rem;
    font-size: 2rem;
    color: #e74c3c;
}

.file-info {
    flex: 1;
}

.file-info h4 {
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.file-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.upload-zone {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: #5a6fd8;
    background: #f0f4ff;
}

.upload-zone.dragover {
    border-color: #28a745;
    background: #f0fff4;
}

.upload-zone i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-zone p {
    color: #6c757d;
    margin-bottom: 1rem;
}

.file-preview-list {
    margin-bottom: 1.5rem;
}

.file-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-preview-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.submission-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.history-list {
    display: grid;
    gap: 1rem;
}

.history-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.history-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.history-item p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.history-item .timestamp {
    color: #28a745;
    font-weight: 500;
}

/* Attendance Control Styles */
.attendance-control {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 2rem;
    overflow: hidden;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.control-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-actions {
    display: flex;
    gap: 1rem;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

.student-list {
    max-height: 400px;
    overflow-y: auto;
}

.student-search {
    padding: 1rem 2rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.student-item:hover {
    background: #f8f9fa;
}

.student-item:last-child {
    border-bottom: none;
}

.student-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.student-id {
    color: #6c757d;
    font-size: 0.9rem;
}

.attendance-status {
    display: flex;
    gap: 0.5rem;
}

.status-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #6c757d;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.status-btn.active {
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.status-btn[data-status="hadir"].active {
    background: #28a745;
}

.status-btn[data-status="sakit"].active {
    background: #ffc107;
    color: #212529;
}

.status-btn[data-status="izin"].active {
    background: #17a2b8;
}

.status-btn[data-status="tanpa_keterangan"].active {
    background: #dc3545;
}

.status-btn i {
    font-size: 0.7rem;
}

/* Responsive for attendance control */
@media (max-width: 768px) {
    .control-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .control-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .student-item {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .attendance-status {
        width: 100%;
        justify-content: space-between;
    }
    
    .status-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .attendance-status {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .status-btn {
        width: 100%;
    }
}

/* NFC Modal Styles */
.nfc-animation {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    margin: 2rem 0;
}

.nfc-icon {
    position: relative;
    z-index: 2;
}

.nfc-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wave {
    position: absolute;
    border: 2px solid #28a745;
    border-radius: 50%;
    opacity: 0;
    animation: nfcWave 2s infinite;
}

.wave1 {
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    animation-delay: 0s;
}

.wave2 {
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    animation-delay: 0.5s;
}

.wave3 {
    width: 160px;
    height: 160px;
    margin: -80px 0 0 -80px;
    animation-delay: 1s;
}

@keyframes nfcWave {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Login Methods Styling */
.login-methods {
    margin-bottom: 1.5rem;
}

.login-methods .flex {
    display: flex;
    flex-wrap: wrap;
}

.login-methods .gap-4 {
    gap: 1rem;
}

.login-methods .justify-center {
    justify-content: center;
}

.login-methods .mb-6 {
    margin-bottom: 1.5rem;
}

/* Enhanced Modal Content */
.modal-content {
    max-width: 600px;
}

/* RFID Programming Modal Styles */
#rfidProgrammingModal .modal-content {
    max-width: 500px;
}

#userSelect {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

#userSelect:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#generatedCode {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
}

#generatedCode code {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
}

/* Admin Tools Styling */
#adminTools {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

#adminTools h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Button Enhancements */
.bg-tappu-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-green-600 {
    background: #28a745;
}

.bg-purple-600 {
    background: #6f42c1;
}

.bg-gray-500 {
    background: #6c757d;
}

.hover\:bg-blue-700:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
}

.hover\:bg-green-700:hover {
    background: #218838;
}

.hover\:bg-purple-700:hover {
    background: #5a32a3;
}

.hover\:bg-gray-600:hover {
    background: #5a6268;
}

/* Responsive NFC Modal */
@media (max-width: 768px) {
    .nfc-animation {
        height: 100px;
    }
    
    .wave1 {
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
    }
    
    .wave2 {
        width: 90px;
        height: 90px;
        margin: -45px 0 0 -45px;
    }
    
    .wave3 {
        width: 120px;
        height: 120px;
        margin: -60px 0 0 -60px;
    }
    
    .login-methods .flex {
        flex-direction: column;
    }
    
    .login-methods button {
        width: 100%;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* ===== NEW KELAS DETAIL STYLES ===== */

/* Materi Card Styles */
.materi-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.materi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.materi-card .materi-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    border-radius: 10px;
    margin-right: 1.5rem;
}

.materi-card .materi-icon i {
    font-size: 1.8rem;
}

.materi-card .materi-content {
    flex: 1;
}

.materi-card .materi-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.materi-card .materi-content p {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.materi-card .materi-content p i {
    margin-right: 0.25rem;
    width: 14px;
}

.materi-card .materi-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tugas Table Styles */
.tugas-table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tugas-table {
    width: 100%;
    border-collapse: collapse;
}

.tugas-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tugas-table th {
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.tugas-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.tugas-table tr:last-child td {
    border-bottom: none;
}

.tugas-table tbody tr {
    transition: background 0.2s ease;
}

.tugas-table tbody tr:hover {
    background: #f8f9fa;
}

.tugas-table td:first-child {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.tugas-table td:nth-child(2) {
    min-width: 250px;
}

.tugas-table td:nth-child(2) strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.25rem;
}

.tugas-table td:nth-child(2) small {
    color: #6c757d;
    font-size: 0.85rem;
}

.tugas-table td:nth-child(3) {
    white-space: nowrap;
    color: #6c757d;
}

.tugas-table .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.tugas-table .status.pending {
    background: #fff3cd;
    color: #856404;
}

.tugas-table .status.submitted {
    background: #d4edda;
    color: #155724;
}

.tugas-table .status.graded {
    background: #d1ecf1;
    color: #0c5460;
}

.tugas-table .status.late {
    background: #f8d7da;
    color: #721c24;
}

.tugas-table .btn-icon.btn-danger {
    color: #dc3545;
}

.tugas-table .btn-icon.btn-danger:hover {
    background: #ffe5e8;
}

/* Absensi Table Styles */
.absensi-table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.absensi-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: flex-end;
}

.absensi-table {
    width: 100%;
    border-collapse: collapse;
}

.absensi-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.absensi-table th {
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.absensi-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.absensi-table tr:last-child td {
    border-bottom: none;
}

.absensi-table tbody tr {
    transition: background 0.2s ease;
}

.absensi-table tbody tr:hover {
    background: #f8f9fa;
}

.absensi-table td:first-child {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.absensi-table td:nth-child(2) {
    min-width: 200px;
}

.absensi-table td:nth-child(3) {
    color: #6c757d;
}

/* Status Select for Editable Attendance */
.status-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.status-select option[value="Hadir"] {
    color: #28a745;
}

.status-select option[value="Sakit"] {
    color: #ffc107;
}

.status-select option[value="Izin"] {
    color: #17a2b8;
}

.status-select option[value="Alpha"] {
    color: #dc3545;
}

/* Status Badge for Students View */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.status-masuk {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-sakit {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-izin {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.status-absen {
    background: #f8d7da;
    color: #721c24;
}

/* Absensi Full Container */
.absensi-full-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Absensi Chart Section */
.absensi-chart-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.absensi-chart-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.absensi-chart-section h3 i {
    color: #667eea;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-box i {
    font-size: 2rem;
}

.stat-box.stat-masuk {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}

.stat-box.stat-masuk i {
    color: #28a745;
}

.stat-box.stat-sakit {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
}

.stat-box.stat-sakit i {
    color: #ffc107;
}

.stat-box.stat-izin {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #17a2b8;
}

.stat-box.stat-izin i {
    color: #17a2b8;
}

.stat-box.stat-absen {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
}

.stat-box.stat-absen i {
    color: #dc3545;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Chart Container in Absensi */
.absensi-chart-section .chart-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem;
}

.absensi-chart-section .chart-container canvas {
    max-height: 300px;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

.empty-state .btn-secondary {
    margin-top: 1rem;
}

/* Kelas Icon Styles */
.kelas-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.kelas-icon i {
    font-size: 2rem;
    color: white;
}

/* Modal for Add Tugas */
#addTugasModal .modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

#addTugasModal .form-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

#addTugasModal .form-group input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #667eea;
    background: #f8f9ff;
}

#addTugasModal .form-group small {
    color: #6c757d;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.5rem;
}

#addTugasModal .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    z-index: 3000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

/* User Avatar Styles */
.user-avatar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive Styles for New Features */
@media (max-width: 768px) {
    .materi-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .materi-card .materi-icon {
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .materi-card .materi-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 1rem;
    }
    
    .tugas-table-container {
        overflow-x: auto;
    }
    
    .tugas-table {
        min-width: 600px;
    }
    
    .absensi-table-container {
        overflow-x: auto;
    }
    
    .absensi-table {
        min-width: 500px;
    }
    
    .absensi-controls {
        flex-direction: column;
    }
    
    .absensi-controls .btn-primary,
    .absensi-controls .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state p {
        font-size: 1rem;
    }
    
    #addTugasModal .form-actions {
        flex-direction: column;
    }
    
    #addTugasModal .form-actions button {
        width: 100%;
    }
}
