:root {
    --primary-color: #1e88e5;
    --secondary-color: #64b5f6;
    --background-color: #f5f5f5;
    --text-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

h1, h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn:hover {
    background: var(--secondary-color);
}

.btn-ranking {
    margin-top: 20px;
    background: #2196f3;
}

.btn-delete {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-delete:hover {
    background: #d32f2f;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: var(--primary-color);
    margin: 15% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    color: white;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

#rankingList {
    margin-top: 20px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.ranking-item .details {
    font-size: 0.8em;
    opacity: 0.8;
}

.score-history {
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    color: black;
}

.score-history h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.score-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: black;
}

.score-item:last-child {
    border-bottom: none;
}

#historyStudentSelect {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin: 10px 0;
    background: white;
    color: var(--text-color);
}

#historyStudentSelect:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-history {
    background: #4CAF50;
    margin-top: 10px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.btn-danger {
    background: #f44336;
    margin-top: 10px;
}

.btn-info {
    background: #2196F3;
    margin-top: 10px;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    color: black;
}

.records-table th,
.records-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    color: black;
}

.records-table th {
    background: #f5f5f5;
    color: black;
}

.month-year-selector {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.month-year-selector select {
    flex: 1;
    padding: 8px;
    border: 2px solid white;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 14px;
}

.month-year-selector select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
}

.main-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.main-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.2);
}

.edit-form {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.edit-form .form-group {
    margin-bottom: 10px;
}

.edit-form label {
    color: var(--text-color);
    margin-bottom: 5px;
    display: block;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-edit {
    background: #2196F3;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-edit:hover {
    background: #1976D2;
}

.btn-save {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-save:hover {
    background: #388E3C;
}

.btn-cancel {
    background: #9E9E9E;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-cancel:hover {
    background: #757575;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .logo {
        max-width: 200px;
    }
    
    .notification {
        width: 90%;
        right: 5%;
    }
    
    .main-btn {
        padding: 15px;
        font-size: 16px;
    }
}