/* General Styles */
@import url('/static/css/heebo-font.css');

body {
    font-family: 'Heebo', sans-serif;
    background-color: #1a1a1a;
    background-image: url('/images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #ffffff;
    margin: 0;
    overflow: hidden; /* Hide scrollbars */
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Main Content Area */
#main-view {
    flex-grow: 1;
    padding: 30px 40px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    height: 100vh;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.view-screen {
    display: none; /* Hidden by default */
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.view-screen.active {
    display: flex;
}
#team-stats {
    font-size: 1.5vw;
    font-weight: 500;
    color: #aaa;
    margin-bottom: 15px;
}
/* Idle Screen */
#idle-screen .logo {
    font-size: 5vw;
    font-weight: 900;
    color: #f60025;
}
#idle-screen p {
    font-size: 3vw;
    color: #260000;
}

/* Question Screen */
#question-screen {
    justify-content: flex-start;
    text-align: left;
}
.question-header {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.question-info {
    flex-shrink: 0;
}

#question-category {
    font-size: 2.5vw;
    font-weight: 400;
    color: #aaa;
    margin: 0;
}

#question-type {
    font-size: 1.8vw;
    font-weight: 700;
    color: #00aaff;
    margin: 0;
}

.question-text {
    flex-grow: 1;
    text-align: left;
}

#question-content {
    font-size: 3.8vw;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.question-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 20px;
}

#question-video-container {
    width: 80%;
    margin: 20px auto;
}
#question-video {
    width: 100%;
    border-radius: 10px;
}
#question-options {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex-shrink: 0;
    max-height: 40vh;
}

#question-options.single-option {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 20px auto 0 auto;
}

#question-options.two-options {
    grid-template-columns: 1fr 1fr;
}

#question-options.four-options {
    grid-template-columns: 1fr 1fr;
}
#question-options li {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 25px 20px;
    font-size: 2.2vw;
    transition: all 0.2s ease;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    backdrop-filter: blur(3px);
}

/* 当只有一个选项时，字体可以更大 */
#question-options.single-option li {
    font-size: 3vw;
    padding: 30px;
    min-height: 120px;
}

/* 当有四个选项时，字体适当调小 */
#question-options.four-options li {
    font-size: 1.8vw;
    padding: 20px 15px;
    min-height: 80px;
}
#question-options li.correct {
    background-color: rgba(40, 167, 69, 0.7);
    border-color: rgba(32, 138, 56, 0.8);
    transform: scale(1.05);
}
#question-options li.incorrect {
    background-color: rgba(220, 53, 69, 0.7);
    border-color: rgba(180, 43, 57, 0.8);
    opacity: 1;
}

#answer-explanation {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 1.5vw;
    color: #ffffff;
    backdrop-filter: blur(3px);
}

/* Group Selection Screen */
#group-selection-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.group-selection-container {
    max-width: 800px;
    width: 90%;
}

.group-selection-header {
    margin-bottom: 40px;
}

.group-selection-header h2 {
    font-size: 4vw;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.group-selection-header p {
    font-size: 2vw;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.group-selection-header span {
    color: #ffcc00;
    font-weight: 700;
}

.group-selection-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.available-groups h3 {
    font-size: 2.5vw;
    margin: 0 0 30px 0;
    color: #ffffff;
    font-weight: 600;
}

#group-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    min-height: 60px;
    align-items: center;
}

.group-tag {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 15px 30px;
    font-size: 2vw;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    min-width: 120px;
}

.group-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.group-tag.selected {
    background: rgba(255, 204, 0, 0.3);
    border-color: #ffcc00;
    color: #ffcc00;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
}

.group-selection-status {
    font-size: 2.2vw;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

.group-selection-status.waiting {
    color: #ffcc00;
    font-weight: 600;
}

.group-selection-status.success {
    color: #28a745;
    font-weight: 600;
}

.group-selection-status.error {
    color: #dc3545;
    font-weight: 600;
}

/* Loading animation for group tags */
.group-tag.loading {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .group-selection-header h2 {
        font-size: 6vw;
    }

    .group-selection-header p,
    .available-groups h3,
    .group-tag,
    .group-selection-status {
        font-size: 3vw;
    }

    .group-tag {
        padding: 12px 20px;
        min-width: 100px;
    }

    .group-selection-content {
        padding: 30px 20px;
    }
}


/* Sidebar */
#sidebar {
    width: 30%;
    max-width: 450px;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-left: 2px solid rgba(0, 170, 255, 0.3);
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
}

.info-panel {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}
#game-phase-title {
    font-size: 2.2vw;
    margin: 0 0 15px 0;
    font-weight: 700;
}
/* Sidebar Timer */
.sidebar-timer {
    font-size: 4vw;
    font-weight: 900;
    color: #ffcc00;
    margin: 15px 0;
    text-align: center;
    line-height: 1;
}

.current-team-display {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0, 170, 255, 0.1);
    border: 2px solid #00aaff;
    border-radius: 10px;
    display: none;
}
.current-team-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.current-team-display .team-name {
    font-size: 1.8vw;
    font-weight: 700;
    color: #00aaff;
    margin-bottom: 5px;
}
.current-team-display .team-score {
    font-size: 1.4vw;
    font-weight: 500;
    color: #ffcc00;
}
.status-message {
    min-height: 80px;
    font-size: 1.8vw;
    font-weight: 700;
    color: #ffcc00;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
}
.status-message.winner {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.scoreboard {
    flex-grow: 1;
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    backdrop-filter: blur(5px);
}
.scoreboard h2 {
    text-align: center;
    font-size: 2vw;
    margin-bottom: 20px;
}
#team-list {
    list-style: none;
    padding: 0;
}
#team-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 5px solid rgba(0, 170, 255, 0.5);
    backdrop-filter: blur(3px);
}
#team-list li.active {
    border-left-color: #ffcc00;
    transform: scale(1.03);
}
#team-list li.buzzer-winner {
    border-left-color: #28a745;
    background-color: #1a3c23;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}
.team-name {
    font-size: 1.8vw;
    font-weight: 700;
}
.team-score {
    font-size: 2.5vw;
    font-weight: 900;
    color: #00aaff;
}

/* Question Media Styles */
#question-media-container {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    min-height: 300px;
}

#question-image {
    max-width: 90%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 6px 25px rgba(0, 170, 255, 0.4);
    background-color: #000;
    transition: transform 0.3s ease;
}

#question-image:hover {
    transform: scale(1.02);
}

#question-audio {
    width: 100%;
    max-width: 500px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 170, 255, 0.2);
}

#question-video {
    max-width: 90%;
    max-height: 60vh;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 170, 255, 0.5);
    background-color: #000;
    transition: transform 0.3s ease;
}

#question-video:hover {
    transform: scale(1.02);
}

/* Media controls styling */
#question-audio audio,
#question-video video {
    width: 100%;
    border-radius: 6px;
}

#question-audio audio::-webkit-media-controls-panel,
#question-video video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

#question-audio audio::-webkit-media-controls-play-button,
#question-video video::-webkit-media-controls-play-button {
    background-color: #00aaff;
    border-radius: 50%;
}

/* Media loading states */
#question-media-container .loading {
    color: #00aaff;
    font-size: 1.2em;
    padding: 20px;
    text-align: center;
}

/* Responsive design for media and layout */
@media (max-width: 768px) {
    .question-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .question-text {
        text-align: left;
        width: 100%;
    }

    #question-content {
        font-size: 4.2vw;
        text-align: left;
    }

    #question-category {
        font-size: 3vw;
    }

    #question-type {
        font-size: 2.2vw;
    }

    #question-media-container {
        max-height: 60vh;
    }

    #question-image {
        max-height: 350px;
    }

    #question-video {
        max-height: 400px;
    }

    .sidebar-timer {
        font-size: 6vw;
    }

    #question-options {
        grid-template-columns: 1fr;
        gap: 15px;
        max-height: none;
    }

    #question-options li {
        font-size: 3vw;
        min-height: 80px;
        padding: 20px;
    }

    #question-options.single-option li {
        font-size: 4vw;
        min-height: 100px;
    }

    #question-options.four-options li {
        font-size: 2.5vw;
        min-height: 70px;
        padding: 15px;
    }
}

/* 题组选择结果样式 */
.selection-result {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 204, 0, 0.5);
    border-radius: 15px;
    padding: 25px 35px;
    margin: 20px auto;
    max-width: 600px;
    backdrop-filter: blur(10px);
}

.selection-result h3 {
    color: #ffcc00;
    font-size: 2.5vw;
    margin: 0 0 20px 0;
    text-align: center;
}

.selection-result p {
    margin: 10px 0;
    font-size: 1.8vw;
    color: rgba(255, 255, 255, 0.9);
}

.selection-result strong {
    color: #ffcc00;
    font-weight: 600;
}

.no-groups {
    font-size: 2vw;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 30px;
    font-style: italic;
}
