/* style.css - Theme Trắng Đỏ (Bright Mode) Sư đoàn 395 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Playfair+Display:wght@700&display=swap');

:root {
    --primary-red: #ce1126;
    --primary-dark: #b71c1c;
    --accent-gold: #ffeb3b;
    --bg-body: #f0f2f5;
    --text-main: #333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body { font-family: 'Roboto', sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 0; overflow-x: hidden; }

/* Utilities */
.btn-army { background: linear-gradient(to bottom, #e53935, #c62828); border: 1px solid #b71c1c; color: white; padding: 12px 24px; text-transform: uppercase; font-weight: bold; border-radius: 6px; text-decoration: none; display: inline-block; box-shadow: 0 4px 6px rgba(211, 47, 47, 0.3); transition: 0.3s; }
.btn-army:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(211, 47, 47, 0.4); color: var(--accent-gold); }
.text-red { color: var(--primary-red); }
.text-blue { color: #1976d2; }

/* Header */
.app-header { background: var(--primary-red); background-image: linear-gradient(45deg, #ce1126 25%, #b71c1c 25%, #b71c1c 50%, #ce1126 50%, #ce1126 75%, #b71c1c 75%, #b71c1c 100%); background-size: 20px 20px; border-bottom: 4px solid var(--accent-gold); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,0.2); color: white; }

/* Grid Card */
.grid-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; padding: 20px; }
.card-lesson { background: white; border-radius: 10px; padding: 20px 10px; text-align: center; transition: 0.3s; cursor: pointer; text-decoration: none; color: #333; box-shadow: var(--shadow); border: 1px solid #e0e0e0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 140px; }
.card-lesson:hover { border-color: var(--primary-red); transform: translateY(-5px); box-shadow: 0 8px 20px rgba(206, 17, 38, 0.15); }
.lesson-icon { font-size: 3rem; margin-bottom: 10px; color: var(--primary-red); background: #fff0f0; width: 60px; height: 60px; line-height: 60px; border-radius: 50%; }

/* List Văn bản */
.doc-list-ul { list-style: none; padding: 0; margin: 0; }
.doc-item { background: white; margin: 8px 0; padding: 15px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-left: 4px solid transparent; transition: 0.2s; }
.doc-item:hover { border-left-color: var(--primary-red); background: #fffdfd; }
.folder-btn { background: #e3f2fd; color: #1565c0; font-weight: bold; }

/* VIEWER BÀI GIẢNG (QUAN TRỌNG) */
.lesson-viewer-container { display: flex; flex-direction: column; height: calc(100vh - 70px); }
.image-area { flex: 1; background: #222; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 0.1s; will-change: transform; box-shadow: 0 0 20px rgba(0,0,0,0.5); }

/* Khu vực tài liệu đính kèm bên dưới ảnh */
.attachment-area { 
    background: white; 
    border-top: 4px solid var(--primary-red); 
    padding: 15px; 
    max-height: 40%; /* Chiếm tối đa 40% màn hình nếu ảnh nhỏ */
    overflow-y: auto;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}
.attachment-title { font-weight: bold; color: var(--primary-dark); margin-bottom: 10px; font-size: 14px; text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.attach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.attach-item { 
    display: flex; align-items: center; padding: 10px; 
    background: #f8f9fa; border: 1px solid #eee; border-radius: 6px; 
    text-decoration: none; color: #333; transition: 0.2s; cursor: pointer;
}
.attach-item:hover { background: #fff3f3; border-color: #ffcdd2; }

/* Modal Viewer */
#docModal { z-index: 2000; } /* Đảm bảo đè lên mọi thứ */

/* Admin Mobile styles */
.login-box { background: white; width: 90%; max-width: 400px; padding: 30px 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); text-align: center; border-top: 5px solid var(--primary-red); }