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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

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

.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #1e3c72;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #1e3c72;
}

main {
    padding: 3rem 20px;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-container h2 {
    color: #1e3c72;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: #666;
    font-size: 0.85rem;
}

.char-counter {
    float: right;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-submit, .btn-add {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-submit:hover, .btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(30, 60, 114, 0.4);
}

.btn-submit:disabled, .btn-add:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.admin-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.admin-header h2 {
    color: #1e3c72;
}

.header-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-preview {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-preview:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-preview:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-generate {
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-generate:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-generate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.admin-section {
    margin-bottom: 3rem;
}

.admin-section h3 {
    color: #34495e;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.inline-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 1fr auto;
    gap: 1rem;
    align-items: end;
}

.form-row input[type="text"],
.form-row select,
.form-row input[type="file"] {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.form-row .btn-add {
    width: auto;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

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

.stat-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.stat-card h4 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.student-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s;
    background: white;
}

.student-card.has-quote {
    border-color: #28a745;
    background-color: #f0fff4;
}

.student-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.student-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.student-info h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.class-badge {
    display: inline-block;
    background: #1e3c72;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.quote {
    font-style: italic;
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.no-quote {
    color: #999;
    font-size: 0.9rem;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-delete {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

.class-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.class-photo-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    background: white;
    transition: all 0.3s;
}

.class-photo-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.class-photo-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.photo-info {
    margin-bottom: 1rem;
}

.caption {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-size: 1.1rem;
}

footer {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
    color: #666;
}

@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row .btn-add {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-header {
        flex-direction: column;
        text-align: center;
    }

    .header-buttons {
        width: 100%;
        flex-direction: column;
    }

    .header-buttons button {
        width: 100%;
    }

    .students-grid {
        grid-template-columns: 1fr;
    }

    .class-photos-grid {
        grid-template-columns: 1fr;
    }
}
