/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f7fa;
}

.hidden {
    display: none !important;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

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

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin: 0 0 1.5rem 0;
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

.error {
    color: #e74c3c;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #ffe5e5;
    border-radius: 5px;
    text-align: center;
}

.login-button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.login-button:hover {
    background: #5568d3;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.logo-section {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-placeholder {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2rem;
}

.class-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    gap: 2rem;
    margin-left: auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    display: block;
    transition: background 0.3s;
    border-radius: 5px;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.5rem;
}

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

.dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown a:hover {
    background: #f5f5f5;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb .separator {
    color: #999;
    margin: 0 0.5rem;
}

.breadcrumb .active {
    color: #667eea;
    font-weight: 600;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
    padding: 2rem;
}

.page.active {
    display: block;
}

/* Dashboard */
.reports-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.report-box {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-box h3 {
    margin: 0 0 1rem 0;
    color: #667eea;
}

.report-box p {
    color: #666;
    font-style: italic;
}

/* Reading Page */
.button-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.log-reading-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.log-reading-btn:hover {
    background: #218838;
}

.review-btn {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.review-btn:hover {
    background: #e0a800;
}

.leaderboard {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard h2 {
    margin: 0 0 1.5rem 0;
    color: #333;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    gap: 1rem;
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: #e9ecef;
}

.medal {
    font-size: 1.5rem;
}

.rank {
    font-weight: 600;
    color: #666;
    min-width: 40px;
}

.student-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.minutes {
    font-weight: 600;
    color: #667eea;
}

/* My Class Page */
.students-table {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

thead {
    background: #667eea;
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 1rem;
    color: #333;
}

.edit-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s;
}

.edit-btn:hover {
    transform: scale(1.2);
}

/* Placeholder Pages */
.placeholder-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.mvp2-text {
    color: red;
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    color: #333;
}

.checkbox-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.students-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.5rem;
}

.students-checkbox-list label {
    display: block;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.students-checkbox-list label:hover {
    background: #f5f5f5;
}

.students-checkbox-list input[type="checkbox"] {
    margin-right: 0.5rem;
}

.checkbox-header input[type="checkbox"] {
    margin-right: 0.5rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
}

.book-search-results {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    width: calc(100% - 4rem);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: -5px;
}

.book-result-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.book-result-item:hover {
    background: #f5f5f5;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.cancel-btn:hover {
    background: #5a6268;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #218838;
}
