/* General body styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px auto;
    line-height: 1.6;
    color: #333;
    background-color: #F0F0F0;
    max-width: 960px;
}

/* Heading styles */
h1, h2, h3 {
    color: #004B8D; /* School color - Blue */
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Adjusted H1 size for better balance with logo */
h1 { font-size: 2.5em; } /* Slightly larger */
h2 { font-size: 1.8em; }
h3 { font-size: 1.4em; }

/* Login container styling */
#login-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 400px;
}

#login-container h2 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

/* Login form element spacing */
#login-form div { margin-bottom: 15px; }

/* Login form labels */
#login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

/* Login form input fields */
#login-form input[type="email"],
#login-form input[type="password"] {
    width: calc(100% - 18px);
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

/* Login form button */
#login-form button {
    background-color: #004B8D;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    transition: background-color 0.3s ease;
}

#login-form button:hover { background-color: #003666; }

/* Error/Success message styling */
.error-message { color: #c0392b; margin-top: 10px; font-size: 0.9em; }
.success-message { color: #27ae60; margin-top: 10px; font-size: 0.9em; }

/* Main application content container */
#app-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 800px;
}

/* Header layout */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* User info display */
#user-info { font-size: 0.9em; color: #666; margin-right: auto; }
#user-email { font-weight: bold; color: #004B8D; }

/* Logout button styling */
#logout-button {
    background-color: #d35400;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}
#logout-button:hover { background-color: #c0392b; }

/* Shared Filter controls layout */
.filter-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
}
.filter-controls div { display: flex; flex-direction: column; }
.filter-controls label { margin-bottom: 5px; font-weight: bold; color: #555; font-size: 0.9em; }
.filter-controls select { padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; min-width: 180px; }

/* Section dividers */
#award-points-container,
#student-list-container,
#store-container,
#admin-area > div {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
#admin-area,
#store-container:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Section headings */
#award-points-container h2,
#student-list-container h2,
#store-container h2,
#admin-area h2,
#admin-area h3 { margin-top: 0; color: #004B8D; }

/* Title Area with Logos (Updated Styles) */
.title-container {
    display: flex;
    align-items: center; /* Vertically align items */
    justify-content: space-between; /* Space out logos and title */
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #004B8D;
}

/* General logo styling */
img.logo {
    height: 65px; /* Slightly smaller height for better balance */
    width: auto; /* Maintain aspect ratio */
    display: block;
    /* Adjust flex properties if needed for fine-tuning */
    flex-shrink: 0; /* Prevent logos from shrinking too much */
}

/* Specific adjustments if needed (optional) */
img.school-logo {
    /* Add specific styles if the school logo needs different sizing */
}
img.district-logo {
     /* Add specific styles if the district logo needs different sizing */
     /* Example: Add slight margin if needed */
     /* margin-left: 10px; */
}

/* Adjust main title alignment and margin */
#main-title {
    margin: 0 15px; /* Add horizontal margin to push logos apart */
    text-align: center; /* Center the title text */
    color: #004B8D;
    line-height: 1.1;
    flex-grow: 1; /* Allow title to take up remaining space */
}


/* Award points form element spacing */
#award-points-form div { margin-bottom: 15px; }
#award-points-form label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
#award-points-form select#points-to-award { padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; max-width: 100px; }

/* Prompt Messages */
.prompt-message {
    font-style: italic;
    color: #666;
    text-align: center;
    padding: 15px;
    background-color: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 15px;
}


/* Student selection area grid layout */
#award-points-form #student-selection-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
    border: none;
    padding: 0;
}
#award-points-form #student-selection-boxes div {
    background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 6px; padding: 8px 10px; cursor: pointer; font-size: 0.9em; color: #333; text-align: center; box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05); user-select: none; transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, transform 0.1s ease; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 40px; word-break: break-word;
}
#award-points-form #student-selection-boxes div:hover { border-color: #ccc; background-color: #f0f0f0; }
#award-points-form #student-selection-boxes div:active { transform: scale(0.98); }
#award-points-form #student-selection-boxes div.selected { background-color: #FFC72C; color: #004B8D; border-color: #e6b828; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1); font-weight: bold; }
#award-points-form #student-selection-boxes input[type="checkbox"] { display: none; }

/* Award points submit button */
#award-points-form button[type="submit"] {
     background-color: #27ae60; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; margin-top: 10px;
}
#award-points-form button[type="submit"]:hover { background-color: #229954; }

/* Leaderboard table styling */
#leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 10px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); border-radius: 8px; overflow: hidden; background-color: #fff; }
#leaderboard-table th, #leaderboard-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
#leaderboard-table th { background-color: #f5f5f5; font-weight: bold; color: #333; }
#leaderboard-table tbody tr:last-child td { border-bottom: none; }
#leaderboard-table td:nth-child(4) { font-weight: bold; color: #E6B828; text-align: center; }

/* --- Store Section Styles --- */
#store-container h2 { color: #004B8D; }
#store-filter-controls { margin-bottom: 20px; }
#spend-points-form div { margin-bottom: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#spend-points-form label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; flex-basis: 150px; flex-shrink: 0; }
#spend-points-form select#store-filtered-student-select { padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; flex-grow: 1; min-width: 200px; }
#spend-points-form input#points-to-spend { padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; width: 80px; }
.points-display { font-weight: bold; color: #E6B828; margin-left: 10px; background-color: #f8f8f8; padding: 5px 10px; border-radius: 4px; border: 1px solid #eee; font-size: 0.9em; white-space: nowrap; }
#spend-points-form button#spend-points-button { background-color: #e67e22; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; margin-left: 160px; }
#spend-points-form button#spend-points-button:hover { background-color: #d35400; }

/* --- Admin Area Styles --- */
#admin-area h2, #admin-area h3 { color: #004B8D; }
#upload-csv-form div { margin-bottom: 15px; }
#upload-csv-form label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
#upload-csv-form input[type="file"] { padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; width: calc(100% - 20px); }
#upload-csv-form button { background-color: #004B8D; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; }
#upload-csv-form button:hover { background-color: #003666; }
#add-student-form div { margin-bottom: 15px; }
#add-student-form label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
#add-student-form input[type="text"] { width: calc(100% - 18px); padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; }
#add-student-form button { background-color: #FFC72C; color: #004B8D; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; font-weight: bold; }
#add-student-form button:hover { background-color: #e6b828; }
