/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    grid-template-areas: 
        "header header"
        "main sidebar";
    min-height: 100vh;
}

/* Header Styles */
.header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

/* Brand Header Styles */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-self: start;
}

.brand-header h1 {
    color: #007460;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.presented-by {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: -0.25rem;
}

/* Clicksotic Branding in Header */
.clicksotic-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.clicksotic-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #007460;
    letter-spacing: 0.5px;
}

.current-team-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #007460, #00a86b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    justify-self: center;
    justify-content: center;
}

.team-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.team-name {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 2rem;
    overflow-y: auto;
}

/* Setup Section */
.setup-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.setup-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

/* Setup Header Styles */
.setup-header {
    text-align: center;
    margin-bottom: 2rem;
}

.setup-header h2 {
    color: #333;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.clicksotic-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.small-logo {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.form-group input {
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #007460;
    box-shadow: 0 0 0 3px rgba(0, 116, 96, 0.1);
}

.form-group input[type="number"] {
    text-align: center;
    font-weight: 600;
    color: #007460;
}

.form-group input[type="number"]:focus {
    border-color: #007460;
    box-shadow: 0 0 0 3px rgba(0, 116, 96, 0.1);
}

.form-group small {
    color: #666;
    font-size: 0.9rem;
}

/* Quiz Section */
.quiz-section {
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007460, #00a86b);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 116, 96, 0.3);
    transition: all 0.3s ease;
}

.timer-circle.warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    animation: pulse 1s infinite;
}

.timer-circle.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 0.5s infinite;
}

.timer-circle.paused {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    animation: none;
}

.timer-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.question-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007460;
}

.question-points {
    background: linear-gradient(135deg, #007460, #00a86b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.question-content {
    margin-bottom: 2rem;
}

.question-content h3 {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #333;
    font-weight: 500;
}

.answer-section {
    margin-bottom: 2rem;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-option {
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.answer-option:hover {
    border-color: #007460;
    background: #f0f9f7;
}

.answer-option.selected {
    border-color: #007460;
    background: linear-gradient(135deg, #007460, #00a86b);
    color: white;
}

.answer-option.correct {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.answer-option.incorrect {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

.option-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.action-buttons-left {
    display: flex;
    gap: 0.5rem;
}

.action-buttons-right {
    display: flex;
    gap: 1rem;
}

.btn-small {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-width: 100px;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    overflow-y: auto;
}

.sidebar-content h3 {
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.leaderboard-item.current-team {
    background: linear-gradient(135deg, #007460, #00a86b);
    color: white;
    transform: scale(1.05);
}

.rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.rank.first {
    background: #ffd700;
    color: #333;
}

.rank.second {
    background: #c0c0c0;
    color: #333;
}

.rank.third {
    background: #cd7f32;
    color: white;
}

.rank.other {
    background: #f0f0f0;
    color: #666;
}

.team-info {
    flex: 1;
}

.team-name {
    font-weight: 600;
    font-size: 1rem;
}

.team-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #007460;
}

.leaderboard-item.current-team .team-score {
    color: white;
}

/* Team Transition Section */
.team-transition-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.team-transition-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.team-transition-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.transition-header {
    text-align: center;
    margin-bottom: 1rem;
}

.transition-header h2 {
    color: #333;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-score-display {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.current-team-score {
    text-align: center;
}

.current-team-score h3 {
    color: #007460;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007460, #00a86b);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 116, 96, 0.3);
    animation: pulse 2s infinite;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.next-team-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.next-team-info h4 {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.next-team-name {
    color: #007460;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #007460, #00a86b);
    color: white;
    border-radius: 25px;
    display: inline-block;
}

.transition-actions {
    margin-top: 1rem;
}

/* Results Section */
.results-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.results-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* Results Header Styles */
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    color: #333;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.final-scores h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #007460, #00a86b);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 116, 96, 0.3);
}

.btn-secondary {
    background: white;
    color: #007460;
    border: 2px solid #007460;
}

.btn-secondary:hover {
    background: #007460;
    color: white;
}

.btn-timer {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border: none;
}

.btn-timer:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.btn-timer:disabled {
    background: #9ca3af;
    color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.answer-result {
    text-align: center;
    padding: 2rem 0;
}

.answer-result.correct {
    color: #10b981;
}

.answer-result.incorrect {
    color: #ef4444;
}

.answer-result.timeout {
    color: #f59e0b;
}

.answer-result i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.answer-result h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.answer-result p {
    font-size: 1.1rem;
    color: #666;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "main"
            "sidebar";
    }
    
    .sidebar {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .header-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .brand-header {
        align-items: center;
        order: 1;
    }
    
    .current-team-indicator {
        order: 2;
    }
    
    .clicksotic-branding {
        order: 3;
        justify-self: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .setup-card, .results-container {
        padding: 2rem;
    }
    
    .question-actions {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-card, .setup-card, .results-container {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.current-team-indicator {
    animation: pulse 2s infinite;
}

/* Floating Restart Button */
.floating-restart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.floating-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}
