/* --- Global Styling & Theme --- */
:root {
    --color-blue: #2a47c0;
    --color-purple: #6a3093;
    --color-cyan: #00d4ff;
    --color-dark-bg: #1a1a2e;
    --color-light-gray: rgba(255, 255, 255, 0.8);
    --color-white: #ffffff;
    --color-error: #ff7a7a;
    --color-success: #7af0a3;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-blue), var(--color-purple), var(--color-cyan));
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.page-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.page-subtitle {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 2rem;
    color: var(--color-light-gray);
}

/* --- Form Styling --- */
.input-group {
    position: relative;
    margin-bottom: 1.75rem;
}

.input-field, .select-field {
    width: 100%;
    background: transparent;
    border: 1px solid var(--color-light-gray);
    border-radius: 8px;
    padding: 14px;
    color: var(--color-white);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.select-field {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23c0c0c0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: .65em auto;
    padding-right: 2.5rem;
}

.select-field option {
    background-color: var(--color-dark-bg);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.input-label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--color-light-gray);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label,
.select-field:focus + .input-label,
.select-field:not([value=""]) + .input-label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    background: #4a3c7d; /* Average of gradient */
    padding: 0 5px;
    border-radius: 4px;
}

.error-message {
    color: var(--color-error);
    font-size: 0.8rem;
    padding-top: 4px;
    min-height: 1.2em;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}
.checkbox-group label {
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 0.5rem;
}
.checkbox-group a {
    color: var(--color-cyan);
    text-decoration: none;
}
.checkbox-group a:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#form-status-message {
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 500;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}
#form-status-message.success {
    background-color: rgba(122, 240, 163, 0.1);
    color: var(--color-success);
    display: block;
}
#form-status-message.error {
    background-color: rgba(255, 122, 122, 0.1);
    color: var(--color-error);
    display: block;
    text-align: left;
}

/* --- Footer --- */
.footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--color-light-gray);
}

/* --- Admin View & Login --- */
.admin-container {
    max-width: 90%;
    width: 1200px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header .page-title {
    margin-bottom: 0;
}

.logout-link {
    color: var(--color-cyan);
    text-decoration: none;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.student-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.student-table th, .student-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.student-table th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.student-table tr:last-child td {
    border-bottom: none;
}

.student-table tr:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.login-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-cyan);
}
