/* Main Theme Styles (from index.php) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header .admin-links {
    margin-top: 15px;
}

.header .admin-links a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background 0.3s;
}

.header .admin-links a:hover {
    background: rgba(255, 255, 255, 0.3);
}

.quiz-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Added helper class for pages that don't toggle visibility */
.quiz-card.static {
    padding: 30px;
    display: block;
}

/* Original active class for quiz flow */
.quiz-card.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s;
}

.question-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.question-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.answers {
    margin-bottom: 25px;
}

.answer-option {
    display: block;
    margin-bottom: 12px;
}

.answer-option label {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1em;
}

.answer-option label:hover {
    background: #e8f4f8;
    border-color: #667eea;
}

.answer-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.answer-option.correct label {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.answer-option.incorrect label {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.answer-option.correct-answer label {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.feedback {
    display: none;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
}

.feedback.show {
    display: block;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.feedback.partial {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-next {
    background: #28a745;
    color: white;
    display: none;
}

.btn-next:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-next.show {
    display: inline-block;
}

.completion-screen {
    display: none;
    text-align: center;
}

.completion-screen.show {
    display: block;
}

.completion-screen h2 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.score {
    font-size: 3em;
    color: #28a745;
    margin: 20px 0;
    font-weight: bold;
}

.score-details {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.btn-restart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    font-size: 1.2em;
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.no-questions {
    text-align: center;
    color: black;
    /* changed to black for visibility inside white card */
    font-size: 1.3em;
}

.no-questions a {
    color: #667eea;
    text-decoration: underline;
}

/* List/Gallery Styles (from list.php) */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.image-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
}

.image-item img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.image-item p {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.image-item a {
    display: inline-block;
    margin-top: 5px;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}

.image-item a:hover {
    background: #0056b3;
}

.image-item button {
    /* Keeping specific selector for delete buttons */
    display: inline-block;
    margin-top: 5px;
    margin-left: 5px;
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.image-item button:hover {
    background: #c82333;
}

.message {
    padding: 10px 20px;
    margin: 10px 0 20px 0;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    text-align: center;
}

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

/* Form Styles for up.php */
.upload-form {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.upload-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.upload-form input[type="file"],
.upload-form input[type="text"] {
    margin-bottom: 20px;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.upload-form input[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: transform 0.2s;
}

.upload-form input[type="submit"]:hover {
    transform: translateY(-2px);
}

.checkbox-group label {
    display: inline-flex;
    /* Changed from block to inline-flex for side-by-side or better flow */
    align-items: center;
    margin-right: 15px;
    /* Spacing between checkboxes */
    font-weight: normal;
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 5px;
}