/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* LISA Color Palette */
:root {
    --lisa-red: #da251c;
    --lisa-white: #ffffff;
    --lisa-grey: #dedede;
    --lisa-charcoal: #71625b;
    --lisa-blue: #1b1b33;
}

/* Login Section Styles */
.login-container {
    background: var(--lisa-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(27, 37, 51, 0.10);
    width: 100%;
    max-width: 400px;
    border-top: 6px solid var(--lisa-red);
    border-bottom: 2px solid var(--lisa-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--lisa-red);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-container h1 img {
    height: 48px;
    width: 48px;
    object-fit: contain;
    margin-bottom: 10px;
    background: var(--lisa-white);
    border-radius: 8px;
    border: 2px solid var(--lisa-grey);
    padding: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--lisa-charcoal);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--lisa-grey);
    background: var(--lisa-white);
    color: var(--lisa-blue);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--lisa-red);
}

button {
    width: 100%;
    padding: 12px;
    background: var(--lisa-blue);
    color: var(--lisa-white);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background: var(--lisa-red);
    color: var(--lisa-white);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--lisa-charcoal);
}

.auth-switch a {
    color: var(--lisa-red);
    text-decoration: none;
}

.auth-switch a:hover {
    color: var(--lisa-blue);
}

.error-message {
    color: var(--lisa-white);
    background: var(--lisa-red);
    border-radius: 5px;
    padding: 10px;
    margin-top: 15px;
    text-align: center;
    display: none;
}

.forgot-password-link {
    color: var(--lisa-blue);
}

.forgot-password-link:hover {
    color: var(--lisa-red);
}

/* Dashboard Section Styles */
#dashboardSection {
    display: block;
    background: var(--lisa-grey);
    padding: 0;
    min-height: 100vh;
    align-items: flex-start;
}

header {
    background: var(--lisa-red);
    color: var(--lisa-white);
    padding: 20px;
    box-shadow: 0 2px 4px rgba(27, 27, 51, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--lisa-white);
    margin: 0;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lisa-logo {
    height: 48px;
    width: 48px;
    object-fit: contain;
    background: var(--lisa-white);
    border-radius: 8px;
    border: 2px solid var(--lisa-grey);
    padding: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--lisa-grey);
}

#logoutBtn {
    width: auto;
    padding: 8px 16px;
    background: var(--lisa-blue);
    color: var(--lisa-white);
}

#logoutBtn:hover {
    background: var(--lisa-charcoal);
}

main {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* DPS Summary Styles */
.dps-summary {
    margin-bottom: 40px;
}

.dps-summary h2 {
    margin-bottom: 20px;
    color: #333;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-top: 4px solid #667eea;
}

.card h3 {
    margin-bottom: 15px;
    color: #666;
    font-size: 1rem;
    font-weight: 600;
}

.dps-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

/* Student Selection Styles */
.student-selection {
    margin-bottom: 30px;
}

.student-selection h2 {
    margin-bottom: 15px;
    color: #333;
}

#studentSelect {
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 16px;
    background: white;
    min-width: 200px;
    cursor: pointer;
}

#studentSelect:focus {
    outline: none;
    border-color: #667eea;
}

/* Events Table Styles */
.events-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#eventsTable {
    width: 100%;
    border-collapse: collapse;
}

#eventsTable th {
    background: var(--lisa-blue);
    color: var(--lisa-white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

#eventsTable td {
    padding: 15px;
    border-bottom: 1px solid #e1e1e1;
}

#eventsTable tbody tr:hover {
    background: #f8f9fa;
}

#eventsTable tbody tr:last-child td {
    border-bottom: none;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status.positive {
    background: #c6f6d5;
    color: #22543d;
}

.status.negative {
    background: #fed7d7;
    color: #742a2a;
}

.status.neutral {
    background: #e2e8f0;
    color: #4a5568;
}

/* Highlight negative points rows in events table */
#eventsTable tbody tr.negative-row {
    background: #fed7d7 !important; /* light red */
    color: #742a2a;
}

/* Loading Styles */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e1e1;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Student DPS Tile Styles */
.student-dps-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--lisa-white);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1.2em;
    min-width: 100px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border-top: 4px solid var(--lisa-red);
    color: var(--lisa-charcoal);
}

.student-dps-tile span {
    font-weight: bold;
    font-size: 1.5em;
    color: #4c51bf;
}

.student-dps-tile label {
    font-size: 0.95em;
    color: #555;
    margin-top: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    main {
        padding: 20px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    #eventsTable {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }
    
    .login-container h1 {
        font-size: 2rem;
    }
}
