* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    padding: 20px 0;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.header p {
    color: #666;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
}

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

label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    font-family: inherit;
}

button:hover {
    opacity: 0.9;
}

button:active {
    opacity: 0.8;
}

.result {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #4a90e2;
}

.error {
    background: #fff5f5;
    border-left-color: #e74c3c;
    color: #c0392b;
}

.success {
    background: #f0f9ff;
    border-left-color: #27ae60;
    color: #229954;
}

.warning {
    background: #fffbf0;
    border-left-color: #f39c12;
    color: #856404;
    margin-top: 10px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: white;
    padding: 12px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.nav a {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s;
}

.nav a:hover {
    background: #f0f0f0;
    color: #333;
}

/* Student Management Styles */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-section h2 {
    margin: 0;
    color: #2c3e50;
    border: none;
    padding: 0;
    font-size: 1.5em;
}

.btn-primary {
    background: #4a90e2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary:hover {
    background: #357abd;
}

.search-section {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    border-color: #4a90e2;
    outline: none;
}

.btn-search {
    background: #555;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-search:hover {
    background: #444;
}

.btn-clear {
    background: #999;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
}

.btn-clear:hover {
    background: #777;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #2c3e50;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.students-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.students-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.students-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.students-table tbody tr {
    transition: background 0.2s;
}

.students-table tbody tr:hover {
    background: #f8f9fa;
}

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

.badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.gpa-badge {
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 13px;
    display: inline-block;
}

.gpa-high {
    background: #e8f5e9;
    color: #2e7d32;
}

.gpa-medium {
    background: #fff9c4;
    color: #f57f17;
}

.gpa-low {
    background: #ffebee;
    color: #c62828;
}

.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-edit {
    background: #4a90e2;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit:hover {
    background: #357abd;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 8px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid #e0e0e0;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    background: #f8f9fa;
    color: #333;
    padding: 16px 20px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    border: none;
    padding: 0;
    font-size: 1.2em;
}

.close {
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 10px;
    color: #333;
}

.warning-text {
    color: #e74c3c;
    font-weight: 500;
}

#studentForm {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 0;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

.btn-cancel {
    background: #999;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

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

.btn-submit {
    background: #4a90e2;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-submit:hover {
    background: #357abd;
}

.btn-delete-confirm {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-delete-confirm:hover {
    background: #c0392b;
}

/* Alert Styles */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 300px;
    border: 1px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-close {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .card {
        padding: 16px;
    }
    
    .nav {
        flex-direction: column;
    }
    
    .nav a {
        text-align: center;
    }
    
    .header-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .students-table {
        font-size: 12px;
    }
    
    .students-table th,
    .students-table td {
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions button {
        width: 100%;
    }
}
