/* FINAL Frontend CSS (Mobile-First) for Forms and Student Dashboard */
:root {
    --primary-color: #008080; --sidebar-bg: #2c3e50; --sidebar-text: #ecf0f1; --sidebar-hover: #34495e; --background-color: #f4f6f9; --white-color: #ffffff; --border-color: #dee2e6; --danger-color: #dc3545;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: var(--background-color); margin: 0; color: #333; }

/* --- GUEST STYLES (Login/Register) --- */
.main-container { padding: 20px; box-sizing: border-box; }
.form-wrapper { width: 100%; background-color: var(--white-color); padding: 20px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); box-sizing: border-box; }
.form-wrapper .logo { display: block; margin: 0 auto 20px auto; max-width: 120px; }
.form-wrapper h2 { text-align: center; margin-bottom: 10px; font-size: 1.5em; }
.form-wrapper p { text-align: center; color: #777; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-control { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 4px; box-sizing: border-box; font-size: 1em; }
.btn { display: inline-block; width: 100%; padding: 12px; border: none; border-radius: 4px; background-color: var(--primary-color); color: var(--white-color); font-size: 16px; font-weight: bold; cursor: pointer; text-align: center; text-decoration: none; transition: background-color 0.3s ease; }
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.form-footer-link { text-align: center; margin-top: 20px; }

/* --- LOGGED-IN STUDENT DASHBOARD STYLES --- */
body.logged-in { padding-top: 60px; }
.navbar { background-color: var(--white-color); padding: 0 15px; height: 60px; border-bottom: 1px solid var(--border-color); position: fixed; top: 0; left: 0; right: 0; z-index: 1001; display: flex; align-items: center; }
.nav-left { display: flex; align-items: center; }
.menu-toggle { font-size: 24px; cursor: pointer; margin-right: 15px; }
.brand { display: flex; align-items: center; text-decoration: none; color: #333; font-weight: bold; }
.nav-logo { height: 35px; margin-right: 10px; }
.brand-text, .nav-right span { display: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 15px; }
.nav-link.logout { color: #c0392b; text-decoration: none; font-weight: bold; }
.sidebar { width: 250px; background-color: var(--sidebar-bg); position: fixed; top: 60px; left: 0; bottom: 0; z-index: 1000; transform: translateX(-100%); transition: transform 0.3s ease-in-out; }
.sidebar.active { transform: translateX(0); }
.sidebar a { display: block; padding: 15px 20px; color: var(--sidebar-text); text-decoration: none; transition: background-color 0.3s; border-top: 1px solid #34495e; }
.sidebar a:first-child { border-top: none; }
.sidebar a:hover, .sidebar a.active { background-color: var(--sidebar-hover); }
.main-content { padding: 20px; }
.page-header { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.page-header h1 { margin: 0; }
.no-content-container { background-color: var(--white-color); padding: 40px; border-radius: 8px; text-align: center; width: 100%; }
.no-content-container p { font-size: 1.2em; margin-bottom: 20px; }
.no-content-container .btn { width: auto; }
.course-grid { display: grid; grid-template-columns: 1fr; gap: 25px; margin-top: 20px; }
.course-card { background-color: var(--white-color); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; border: 1px solid var(--border-color); }
.course-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.course-image { width: 100%; height: 180px; object-fit: cover; display: block; }
.course-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.course-title { font-size: 1.25em; font-weight: bold; margin: 0 0 5px 0; color: #333; }
.course-level { font-size: 0.9em; color: #6c757d; margin: 0 0 15px 0; font-weight: 500; }
.course-description { font-size: 0.95em; line-height: 1.6; color: #555; flex-grow: 1; margin-bottom: 20px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 15px; font-size: 0.85em; color: #555; margin-bottom: 15px; }
.course-meta span { background-color: #f0f8ff; padding: 5px 10px; border-radius: 4px; border: 1px solid #dee2e6; }
.course-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; border-top: 1px solid #f0f0f0; padding-top: 15px; }
.course-price { font-size: 1.4em; font-weight: bold; color: var(--primary-color); }
.btn-enroll { padding: 10px 15px; background-color: var(--primary-color); color: var(--white-color); border: none; border-radius: 5px; cursor: pointer; font-weight: bold; font-size: 0.9em; transition: background-color 0.3s ease; text-transform: uppercase; text-decoration: none; }
.btn-enroll:hover { background-color: #006666; }
.progress-bar-container { width: 100%; height: 10px; background-color: #e9ecef; border-radius: 5px; margin-top: auto; margin-bottom: 5px; }
.progress-bar { height: 100%; background-color: var(--primary-color); border-radius: 5px; transition: width 0.5s ease-in-out; }
.progress-text { font-size: 0.8em; color: #6c757d; margin-bottom: 15px; }
.my-course-card .course-footer { display: flex; gap: 10px; }
.my-course-card .course-footer .btn-enroll, .my-course-card .course-footer .btn-unenroll { flex-grow: 1; width: auto; padding: 12px 10px; font-size: 0.9em; }
.my-course-card .course-footer .btn-unenroll { background-color: var(--danger-color); }
.my-course-card .course-footer .btn-unenroll:hover { background-color: #c82333; }

/* --- RESPONSIVE BREAKPOINTS --- */
@media (min-width: 600px) { .main-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 0; } .form-wrapper { max-width: 450px; padding: 40px; } .form-wrapper .logo { max-width: 150px; } .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 576px) { .brand-text, .nav-right span { display: inline; } }
@media (min-width: 992px) { body.logged-in { padding-left: 250px; } .menu-toggle { display: none; } .sidebar { transform: translateX(0); } .main-content { margin-left: 0; } .page-header { flex-direction: row; justify-content: space-between; align-items: center; } .course-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .course-grid { grid-template-columns: repeat(4, 1fr); } }