/* ===================================================================
   THỊ TRƯỜNG BẤT ĐỘNG SẢN - COMPLETE STYLESHEET
   =================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

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

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-box .logo {
    font-size: 50px;
    margin-bottom: 10px;
}

.login-box h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 5px;
}

.login-box h2 {
    color: #666;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 30px;
}

.login-box .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.login-box .form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #f9f9f9;
}

.login-box .form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.login-box .btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.login-box .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.login-footer strong {
    color: #333;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #dc2626;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #22c55e;
    color: #16a34a;
}

/* ===================================================================
   STUDENT PAGES - NAVBAR
   =================================================================== */
.student-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.student-navbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.student-navbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.student-navbar .nav-menu {
    display: flex;
    gap: 5px;
    align-items: center;
}

.student-navbar .nav-menu a {
    color: #333;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

.student-navbar .nav-menu a:hover {
    background: #f0f0f0;
    color: #667eea;
}

.student-navbar .nav-menu a.active {
    background: #667eea;
    color: white;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown .dropdown-toggle {
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 10px;
    z-index: 1000;
    padding: 10px 0;
    margin-top: 5px;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-dropdown .dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333 !important;
    text-decoration: none;
    transition: all 0.3s;
    background: none !important;
}

.nav-dropdown .dropdown-menu a:hover {
    background: #f0f0ff !important;
    color: #667eea !important;
}

.student-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-level {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.badge-money {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* ===================================================================
   STUDENT PAGES - CONTENT
   =================================================================== */
.student-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

.page-title {
    color: white;
    font-size: 32px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 20px;
    color: #667eea;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats Grid */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-box h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-box .value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}

.stat-box .value.money {
    color: #22c55e;
}

.stat-box .progress-bar {
    background: #eee;
    border-radius: 10px;
    height: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.stat-box .progress-bar .progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 10px;
}

/* Quick Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.action-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.action-card .icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.action-card span {
    display: block;
    font-size: 14px;
}

/* ===================================================================
   TABLES
   =================================================================== */
.table-container {
    overflow-x: auto;
}

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

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

table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

table tr:hover {
    background: #f9f9f9;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.badge-active {
    background: #dcfce7;
    color: #16a34a;
}

.badge-locked {
    background: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background: #dbeafe;
    color: #2563eb;
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===================================================================
   FORMS
   =================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .student-navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .student-navbar .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===================================================================
   ADMIN PAGES - DARK THEME
   =================================================================== */
body.admin-theme {
    background: #1a1a2e;
    color: #fff;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: #16213e;
    padding: 20px 0;
    border-right: 1px solid #0f3460;
}

.sidebar-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #0f3460;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    color: #e94560;
    font-size: 18px;
    margin-bottom: 10px;
}

.sidebar-header .admin-badge {
    background: #e94560;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
}

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

.sidebar-menu li {
    margin: 5px 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #a0a0a0;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #0f3460;
    color: #fff;
}

.sidebar-menu a.active {
    border-left: 3px solid #e94560;
}

.sidebar-menu .icon {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-menu .logout a {
    color: #e94560;
}

.sidebar-menu .logout a:hover {
    background: #e94560;
    color: white;
}

.main-content {
    margin-left: 220px;
    padding: 30px;
    min-height: 100vh;
}

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.page-header p {
    opacity: 0.8;
}

/* Admin Stats */
body.admin-theme .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

body.admin-theme .stat-card {
    background: #16213e;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid #0f3460;
}

body.admin-theme .stat-card .icon {
    font-size: 40px;
    margin-bottom: 15px;
}

body.admin-theme .stat-card .stat-value {
    font-size: 36px;
    font-weight: bold;
}

body.admin-theme .stat-card .stat-label {
    color: #a0a0a0;
    font-size: 14px;
}

body.admin-theme .stat-card.purple { border-top: 3px solid #a855f7; }
body.admin-theme .stat-card.blue { border-top: 3px solid #3b82f6; }
body.admin-theme .stat-card.green { border-top: 3px solid #22c55e; }
body.admin-theme .stat-card.yellow { border-top: 3px solid #eab308; }
body.admin-theme .stat-card.red { border-top: 3px solid #e94560; }

/* Admin Cards */
body.admin-theme .card {
    background: #16213e;
    border: 1px solid #0f3460;
}

body.admin-theme .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #0f3460;
}

body.admin-theme .card-title {
    color: #fbbf24;
}

/* Admin Tables */
body.admin-theme table th {
    background: #0f3460;
    color: #fbbf24;
}

body.admin-theme table td {
    color: #e0e0e0;
    border-bottom: 1px solid #0f3460;
}

body.admin-theme table tr:hover {
    background: #1e3a5f;
}

/* Admin Forms */
body.admin-theme .form-group label {
    color: #fbbf24;
}

body.admin-theme .form-control {
    background: #0f3460;
    border: 1px solid #1e3a5f;
    color: white;
}

body.admin-theme .form-control:focus {
    border-color: #667eea;
}

body.admin-theme .form-control::placeholder {
    color: #6b7280;
}

/* Admin Tabs */
body.admin-theme .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 10px;
}

body.admin-theme .tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    border-radius: 8px;
}

body.admin-theme .tab-btn:hover,
body.admin-theme .tab-btn.active {
    background: #0f3460;
    color: #fbbf24;
}

/* Admin Alerts */
body.admin-theme .alert-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #22c55e;
}

body.admin-theme .alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

/* Admin Buttons */
body.admin-theme .btn-outline {
    background: transparent;
    border: 1px solid #0f3460;
    color: #a0a0a0;
}

body.admin-theme .btn-outline:hover {
    background: #0f3460;
    color: white;
}

/* Quick Actions */
body.admin-theme .quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

body.admin-theme .action-btns {
    display: flex;
    gap: 8px;
}

body.admin-theme .action-btns .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #16213e;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #0f3460;
}

.modal-title {
    color: #fbbf24;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 24px;
    cursor: pointer;
}

/* File Upload */
.file-upload {
    border: 2px dashed #0f3460;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
}

.file-upload:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.file-upload input[type="file"] {
    display: none;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Content Editor */
textarea.content-editor {
    min-height: 300px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* HTML Guide */
.html-guide {
    background: #0f3460;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.html-guide h4 {
    color: #fbbf24;
    margin-bottom: 15px;
}

.html-guide code {
    background: #1a1a2e;
    padding: 3px 8px;
    border-radius: 4px;
    color: #22c55e;
}

/* Format Toggle */
.format-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.format-btn {
    padding: 12px 25px;
    border: 2px solid #0f3460;
    background: transparent;
    color: #a0a0a0;
    border-radius: 8px;
    cursor: pointer;
}

.format-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
}











/* ===================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ===================================================================
   Thêm đoạn này vào CUỐI file style.css cũ
   hoặc THAY THẾ toàn bộ file nếu muốn
   =================================================================== */

/* ===================================================================
   0. VIEWPORT META TAG (Thêm vào index.html/login.jsp)
   =================================================================== */
/*
<meta name="viewport" content="width=device-width, initial-scale=1.0">
*/

/* ===================================================================
   1. BASE STYLES (Mobile First - 320px+)
   =================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    font-size: 16px; /* Mobile: 16px minimum cho dễ đọc */
}

/* ===================================================================
   2. LOGIN PAGE - RESPONSIVE
   =================================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px; /* Mobile: padding để tránh sát mép */
}

.login-container {
    width: 100%; /* Mobile: full width */
    max-width: 450px;
    padding: 10px; /* Mobile: padding nhỏ hơn */
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 30px 20px; /* Mobile: padding nhỏ hơn */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-box .logo {
    font-size: 40px; /* Mobile: nhỏ hơn */
    margin-bottom: 10px;
}

.login-box h1 {
    color: #667eea;
    font-size: 24px; /* Mobile: nhỏ hơn */
    margin-bottom: 5px;
}

.login-box h2 {
    color: #666;
    font-size: 14px; /* Mobile: nhỏ hơn */
    font-weight: normal;
    margin-bottom: 20px; /* Mobile: margin nhỏ hơn */
}

.login-box .form-control {
    width: 100%;
    padding: 12px; /* Mobile: padding vừa phải */
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px; /* QUAN TRỌNG: 16px tránh zoom trên iOS */
    transition: border-color 0.3s;
    background: #f9f9f9;
}

.login-box .btn-login {
    width: 100%;
    padding: 15px;
    min-height: 48px; /* Touch-friendly (Apple guideline: 44px+) */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px; /* Mobile: đủ lớn để đọc */
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

/* ===================================================================
   3. DASHBOARD - RESPONSIVE
   =================================================================== */

.dashboard-container {
    width: 100%; /* Mobile: full width */
    padding: 10px; /* Mobile: padding nhỏ */
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 column */
    gap: 15px; /* Mobile: gap nhỏ hơn */
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 15px; /* Mobile: padding nhỏ hơn */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    font-size: 30px; /* Mobile: nhỏ hơn */
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 24px; /* Mobile: nhỏ hơn */
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 13px; /* Mobile: nhỏ hơn */
    color: #666;
}

/* ===================================================================
   4. BUTTONS - TOUCH FRIENDLY
   =================================================================== */

.btn {
    display: inline-block;
    padding: 12px 20px;
    min-height: 44px; /* Touch-friendly */
    min-width: 44px;  /* Touch-friendly */
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

/* ===================================================================
   5. CARDS GRID - RESPONSIVE
   =================================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 card/hàng */
    gap: 15px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===================================================================
   6. COURSE LIST - RESPONSIVE
   =================================================================== */

.course-item {
    background: white;
    border-radius: 15px;
    padding: 15px; /* Mobile: padding nhỏ hơn */
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.course-item .course-header {
    display: flex;
    flex-direction: column; /* Mobile: stack vertically */
    gap: 10px;
}

.course-item .course-title {
    font-size: 18px; /* Mobile: vừa phải */
    font-weight: bold;
    color: #333;
}

/* ===================================================================
   7. TABLES - RESPONSIVE (Scroll horizontal trên mobile)
   =================================================================== */

.table-container {
    width: 100%;
    overflow-x: auto; /* Mobile: cho phép scroll ngang */
    -webkit-overflow-scrolling: touch; /* Smooth scroll trên iOS */
}

.table {
    width: 100%;
    min-width: 600px; /* Table sẽ scroll nếu màn hình nhỏ hơn 600px */
    border-collapse: collapse;
}

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

/* ===================================================================
   8. NAVIGATION - RESPONSIVE
   =================================================================== */

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px; /* Mobile: padding nhỏ hơn */
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Mobile: wrap nếu cần */
}

.navbar-brand {
    font-size: 20px; /* Mobile: nhỏ hơn */
    font-weight: bold;
    color: #667eea;
}

.navbar-menu {
    display: flex;
    gap: 10px; /* Mobile: gap nhỏ hơn */
    flex-wrap: wrap; /* Mobile: wrap nếu cần */
}

/* ===================================================================
   9. MODAL - RESPONSIVE
   =================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Mobile: padding */
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    width: 100%; /* Mobile: full width */
    max-width: 500px;
    max-height: 90vh; /* Mobile: không quá cao */
    overflow-y: auto; /* Mobile: scroll nếu nội dung dài */
}

/* ===================================================================
   10. FORM ELEMENTS - MOBILE FRIENDLY
   =================================================================== */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px; /* QUAN TRỌNG: 16px tránh zoom trên iOS */
    font-family: inherit;
}

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

/* ===================================================================
   11. UTILITIES
   =================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.hide-mobile {
    display: block;
}

/* ===================================================================
   MEDIA QUERIES - TABLET (768px+)
   =================================================================== */

@media (min-width: 768px) {
    body {
        font-size: 14px; /* Desktop có thể nhỏ hơn */
    }

    .login-box {
        padding: 40px; /* Tablet: padding lớn hơn */
    }

    .login-box .logo {
        font-size: 50px;
    }

    .login-box h1 {
        font-size: 28px;
    }

    .login-box h2 {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .dashboard-container {
        padding: 20px; /* Tablet: padding lớn hơn */
    }

    /* Stats Grid: 2 columns trên tablet */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Cards Grid: 2 columns trên tablet */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-card .stat-icon {
        font-size: 40px;
    }

    .stat-card .stat-value {
        font-size: 32px;
    }

    .course-item {
        padding: 20px;
    }

    .course-item .course-header {
        flex-direction: row; /* Tablet: horizontal */
        justify-content: space-between;
        align-items: center;
    }

    .navbar {
        padding: 15px;
    }

    .navbar-brand {
        font-size: 24px;
    }

    .navbar-menu {
        gap: 15px;
    }
}

/* ===================================================================
   MEDIA QUERIES - DESKTOP (1024px+)
   =================================================================== */

@media (min-width: 1024px) {
    .dashboard-container {
        max-width: 1200px;
        margin: 0 auto; /* Center trên desktop */
        padding: 30px;
    }

    /* Stats Grid: 4 columns trên desktop */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }

    /* Cards Grid: 3 columns trên desktop */
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .stat-card {
        padding: 20px;
    }

    .btn {
        padding: 15px 30px;
        font-size: 16px;
    }

    .table th,
    .table td {
        padding: 15px;
    }

    .hide-mobile {
        display: block;
    }
}

/* ===================================================================
   MEDIA QUERIES - LARGE DESKTOP (1440px+)
   =================================================================== */

@media (min-width: 1440px) {
    .dashboard-container {
        max-width: 1400px;
    }

    .stats-grid {
        gap: 30px;
    }

    .cards-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns trên large desktop */
        gap: 30px;
    }
}

/* ===================================================================
   MEDIA QUERIES - MOBILE ONLY (<768px)
   =================================================================== */

@media (max-width: 767px) {
    /* Ẩn elements không cần thiết trên mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Full width buttons trên mobile */
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Stack form elements */
    .form-row {
        flex-direction: column;
    }

    .form-col {
        width: 100%;
    }
}

/* ===================================================================
   DARK MODE SUPPORT (Optional)
   =================================================================== */

@media (prefers-color-scheme: dark) {
    /* Uncomment nếu muốn hỗ trợ dark mode */
    /*
    body {
        background: #1a1a1a;
        color: #fff;
    }

    .card,
    .login-box,
    .stat-card {
        background: #2d2d2d;
        color: #fff;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    textarea,
    select {
        background: #1a1a1a;
        color: #fff;
        border-color: #444;
    }
    */
}

/* ===================================================================
   PRINT STYLES (Bonus)
   =================================================================== */

@media print {
    .navbar,
    .btn,
    .hide-print {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    .dashboard-container {
        max-width: 100%;
    }
}

/* ===================================================================
   ANIMATIONS (Smooth)
   =================================================================== */

@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}

/* ===================================================================
   ACCESSIBILITY
   =================================================================== */

/* Focus visible cho keyboard navigation */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Skip link cho screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #667eea;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ===================================================================
   COMPLETE! ✅
   ===================================================================
   File này có thể:
   1. THÊM vào cuối file style.css cũ
   2. HOẶC thay thế toàn bộ file style.css cũ

   Test responsive:
   - Chrome DevTools → Toggle Device Toolbar (Ctrl+Shift+M)
   - Test: iPhone SE (375px), iPad (768px), Desktop (1920px)
   =================================================================== */
.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    padding: 12px 30px;
    border-radius: 10px;
}