/* Basic body and container styling */
body { 
    font-family: Arial, sans-serif; 
    background: #fff; 
    padding: 1rem; 
    display: flex; 
    transition: all 0.3s ease;
}
h1 { text-align: center; margin: 0.5rem 0; font-size: 1.8em; }
.main-content { 
    flex-grow: 1; 
    padding: 1rem; 
    transition: margin-left 0.3s ease;
}
.container { max-width: 1400px; margin: 0 auto; background: white; padding: 1rem; position: relative; }

/* Table and cell styling */
table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 2rem 0; }
th, td { border: 1px solid #000; padding: 0.25rem; text-align: center; min-width: 24px; }

/* Specific cell types */
.label-cell { font-weight: bold; background: #eee; }
.score-cell { 
    cursor: pointer; 
    user-select: none; 
    pointer-events: auto;
}

/* Score cell states */
.score-cell.correct { background: #c8e6c9; }
.score-cell.incorrect { background: #ffcdd2; }
.score-cell.bonus { background: #bbdefb; }
.score-cell.bonus-correct { background: #82b1ff; }
.score-cell.bonus-incorrect { background: #e3f2fd; }
.score-cell.unanswered { background: #ffeb3b; }

/* Quizzer row states */
tr.quiz-out {
    background-color: #e8f5e8 !important;
    opacity: 0.7;
}

tr.error-out {
    background-color: #ffeaea !important;
    opacity: 0.7;
}



/* Question header styling */
.question-header { 
    cursor: pointer; 
    user-select: none; 
    background: #f5f5f5; 
    position: relative;
    padding: 2px;
}
.question-header:hover { background: #e0e0e0; }
.question-header.unanswered { background: #ffcccb; font-weight: bold; color: #cc0000; }

.question-type-select {
    position: absolute;
    top: 1px;
    left: 1px;
    font-size: 0.6em;
    font-weight: bold;
    border: none;
    background: rgba(255,255,255,0.9);
    padding: 1px;
    border-radius: 2px;
    width: 16px;
    height: 14px;
    appearance: none;
    text-align: center;
    cursor: pointer;
}
.question-type-select:hover {
    background: rgba(255,255,255,1);
}
.question-number {
    display: block;
    margin-top: 8px;
}

/* Input field for names and team names */
.name-input, .team-name-input { 
  width: 100%; 
  border: none; 
  text-align: center; 
  font-weight: bold; 
  background: #eee; 
  padding: 0.25rem;
  box-sizing: border-box;
}

/* Quiz controls styling */
.quiz-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.quiz-controls div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.quiz-controls label {
    font-size: 0.85em;
    margin-bottom: 3px;
    font-weight: bold;
    color: #333;
}
.quiz-controls input[type="text"],
.quiz-controls input[type="number"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    width: 150px;
}
.quiz-controls button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}
.quiz-controls button:hover {
    background-color: #0056b3;
}

/* Team toggle styling */
.team-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 5px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.team-toggle-container input[type="radio"] {
    display: none;
}

.team-toggle-container label {
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: bold;
    color: #555;
    flex-grow: 1;
    text-align: center;
}

.team-toggle-container input[type="radio"]:checked + label {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Navigation Panel Styles */
.navigation-panel {
    width: 250px;
    background-color: #f0f0f0;
    padding: 1rem;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    flex-shrink: 0; 
    position: relative;
    transition: width 0.3s ease;
}

.navigation-panel h2 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#newQuizMeetBtn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.5em;
    padding: 0;
    margin: 0;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#newQuizMeetBtn:hover {
    background-color: #218838;
}

.navigation-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quiz-meet-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background-color: #e9e9e9;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
    font-weight: bold;
    margin-bottom: 5px;
    gap: 5px;
}

.quiz-meet-item:hover {
    background-color: #dcdcdc;
}

.quiz-meet-item.active {
    background-color: #007bff;
    color: white;
}

.quiz-round-item {
    display: flex;
    align-items: center;
    font-weight: normal;
    background-color: #f5f5f5;
    margin-left: 20px;
    font-size: 0.9em;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 3px;
    gap: 5px;
    color: #007bff;
    text-decoration: none;
}

.quiz-round-item:hover {
    background-color: #e0e0e0;
    text-decoration: underline;
}

.quiz-round-item.active {
    background-color: #82b1ff;
    color: white;
    font-weight: bold;
}

.round-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.round-list.expanded {
    max-height: none;
}

/* Modal styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease;
}

.custom-modal-overlay.visible {
    visibility: visible;
    opacity: 1;
}

.custom-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.hidden {
    display: none !important;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 14px;
}

.back-btn:hover {
    background: #5a6268;
}

.tab-container {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-right: 1px solid #dee2e6;
    transition: background 0.2s;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.tab-content {
    padding: 20px;
}

.quiz-nav-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-nav-buttons button {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.quiz-nav-buttons button:hover {
    background: #0056b3;
}

.sub-btn {
    padding: 2px 6px;
    font-size: 0.7em;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.sub-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.sub-btn:hover:not(:disabled) {
    background: #218838;
}

.delete-round-btn, .delete-quiz-btn {
    color: #dc3545;
    font-weight: bold;
    cursor: pointer;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    flex-shrink: 0;
}

.delete-round-btn:hover, .delete-quiz-btn:hover {
    background: #dc3545;
    color: white;
}

.quiz-meet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-round-item {
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.quiz-round-item > span:first-child {
    flex-grow: 1;
}

