/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #f8fafc;
    padding: 1rem;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* 컨테이너 스타일 */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
    height: calc(100vh - 4rem);
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

/* 컨테이너 위치 및 크기 조절 */
.selection-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    transform: none;
    width: calc(100% - clamp(240px, 24vw, 370px) - 4rem);
    max-width: none;
    height: calc(100vh - 4rem);
    background: white;
    border-radius: 1rem;
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.1);
    padding: clamp(0.5rem, 1vw, 1rem);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 남은 질문 수 표시 */
.remaining-questions {
    background: white;
    border-radius: clamp(0.5rem, 1vw, 1rem);
    padding: clamp(1rem, 1.5vw, 1.5rem);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05),
               0 10px 15px -3px rgba(0, 0, 0, 0.1),
               0 0 0 1px rgba(0, 0, 0, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.25rem, 0.5vw, 0.5rem);
    min-height: clamp(120px, 15vh, 180px);
    transition: box-shadow 0.3s ease;
}

.remaining-questions:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
               0 20px 25px -5px rgba(0, 0, 0, 0.1),
               0 0 0 1px rgba(0, 0, 0, 0.05);
}

.remaining-text {
    font-size: clamp(1rem, 1.8vw, 1.8rem);
    color: #64748b;
    line-height: 1.2;
}

.remaining-count {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
}

/* 타이머 컨테이너 */
.timer-container {
    background: white;
    border-radius: clamp(0.5rem, 1vw, 1rem);
    padding: clamp(0.75rem, 1vw, 1rem);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05),
               0 10px 15px -3px rgba(0, 0, 0, 0.1),
               0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: clamp(120px, 15vh, 180px);
    transition: box-shadow 0.3s ease;
}

.timer-container:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
               0 20px 25px -5px rgba(0, 0, 0, 0.1),
               0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* 시계 크기 */
.timer-clock {
    font-size: clamp(3.2rem, 6.48vw, 6.48rem);
    font-weight: 700;
    text-align: center;
    color: #0f172a;
    font-family: 'Noto Sans Mono', monospace;
    letter-spacing: -2px;
    line-height: 1;
}

/* 질문 리스트 스타일 */
.questionList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: transparent;
    border-radius: 0.75rem;
    padding: 0.5rem;
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* 스크롤바 스타일 */
.questionList::-webkit-scrollbar {
    width: 8px;
}

.questionList::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.questionList::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.questionList::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* 질문 목록 영역 */
#questionList {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 질문 아이템 스타일 */
.questionList-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    gap: 0.75rem;
    height: auto;
}

.questionList-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 상태별 스타일 */
.questionList-item.waiting {
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
    position: relative;
}

.questionList-item.waiting::before {
    content: 'Q';
    position: absolute;
    left: 0.25rem;
    top: 0.1rem;
    width: auto;
    height: auto;
    background: transparent;
    color: #3b82f6;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    box-shadow: none;
    border: none;
}

.questionList-item.selected {
    border-left: 4px solid #22c55e;
    background: #f0fdf4;
}

.questionList-item.selected .questionList-content {
    position: relative;
}

.questionList-item.selected .questionList-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #22c55e;
    animation: underline 0.3s ease forwards;
    animation-delay: 0.3s;
}

@keyframes underline {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.questionList-item.completed {
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
}

.questionList-item.completed .questionList-content {
    opacity: 0.7;
    color: #64748b;
}

/* 질문 내용 스타일 */
.questionList-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    padding: 0.25rem 1rem;
    font-size: 1.3rem;
    line-height: 1.4;
    color: #1e293b;
    word-break: break-word;
    hyphens: auto;
    overflow: visible;
    text-overflow: clip;
    display: block;
    white-space: pre-wrap;
    height: auto;
}

/* 버튼 스타일 */
.questionList-btn {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.questionList-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.questionList-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 상태별 버튼 스타일 */
.questionList-item.waiting .questionList-btn {
    background: #3b82f6;
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    }
    to {
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.8);
    }
}

.questionList-item.selected .questionList-btn {
    background: #22c55e;
    color: white;
}

.questionList-item.completed .questionList-btn {
    background: #94a3b8;
    color: white;
    opacity: 0.7;
}

/* 삭제 버튼 스타일 */
.questionList-btn-delete {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    box-shadow: none !important;
    animation: none !important;
}

.questionList-btn-delete:hover {
    background: #fecaca !important;
}

/* 빈 상태 스타일 */
.questionList-empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 1.1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
}

/* 에러 상태 스타일 */
.questionList-error {
    text-align: center;
    padding: 1rem;
    color: #ef4444;
    background: #fee2e2;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .selection-container {
        width: calc(100% - clamp(240px, 24vw, 370px) - 4rem);
        max-width: none;
    }
}

@media (max-width: 992px) {
    .selection-container {
        width: calc(100% - clamp(220px, 20vw, 320px) - 4rem);
        max-width: none;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        padding-bottom: 1rem;
    }

    .selection-container {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        height: auto;
        min-height: calc(100vh - 180px);
        border-radius: 0;
        padding: 0;
        margin-top: 180px;
    }

    .remaining-questions,
    .timer-container {
        flex: 1;
        padding: clamp(0.75rem, 1vw, 1rem);
        height: auto;
        min-height: clamp(100px, 12vh, 120px);
    }

    .remaining-text {
        font-size: clamp(1rem, 1.4vw, 1.4rem);
    }

    .remaining-count {
        font-size: clamp(1.8rem, 2.2vw, 2.2rem);
    }

    .timer-clock {
        font-size: clamp(3.5rem, 4.5vw, 4.5rem);
    }

    .questionList-item {
        flex-direction: column;
        gap: clamp(0.5rem, 1vw, 1rem);
    }

    .questionList-content {
        width: 100%;
        margin-right: 0;
        margin-bottom: clamp(0.5rem, 1vw, 1rem);
    }

    .questionList-actions {
        width: 100%;
        min-width: 100%;
    }

    .questionList-item.waiting::before {
        left: 0.25rem;
        top: 0.25rem;
        width: auto;
        height: auto;
        font-size: 0.75rem;
        border: none;
    }
}

@media (max-width: 576px) {
    body {
        padding-bottom: 0.5rem;
    }

    .selection-container {
        margin-top: 240px;
        min-height: calc(100vh - 240px);
    }

    .remaining-questions,
    .timer-container {
        width: 100%;
        min-height: clamp(80px, 10vh, 100px);
    }

    .remaining-text {
        font-size: clamp(0.9rem, 1.2vw, 1.2rem);
    }

    .remaining-count {
        font-size: clamp(1.6rem, 2vw, 2rem);
    }

    .timer-clock {
        font-size: clamp(3rem, 4vw, 4rem);
    }

    .questionList {
        padding: clamp(0.25rem, 0.5vw, 0.5rem);
    }

    .questionList-item {
        padding: clamp(0.75rem, 1vw, 1rem);
    }

    .questionList-content {
        padding: clamp(0.5rem, 0.75vw, 0.75rem);
    }

    .questionList-btn {
        padding: clamp(0.4rem, 0.6vw, 0.6rem) clamp(0.6rem, 0.9vw, 0.9rem);
        font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    }

    .questionList-item.waiting::before {
        width: auto;
        height: auto;
        font-size: 0.625rem;
        left: 0.125rem;
        top: 0.125rem;
        border: none;
    }
}

/* 태블릿 가로 모드 */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .selection-container {
        width: calc(100% - clamp(220px, 20vw, 320px) - 4rem);
        max-width: none;
    }
}

/* 커스텀 확인 팝업 스타일 */
.questionList-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.questionList-popup.active {
    display: flex;
}

.questionList-popup-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.questionList-popup-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.questionList-popup-message {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.questionList-popup-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.questionList-popup-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.questionList-popup-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.questionList-popup-btn-cancel:hover {
    background: #e2e8f0;
}

.questionList-popup-btn-confirm {
    background: #ef4444;
    color: white;
}

/* 버튼 컨테이너 */
.questionList-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 144px;
    height: 2.52rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
}

/* 사이드바 스타일 */
.sidebar {
    position: fixed;
    top: 2rem;
    left: calc(2rem - 5px);
    width: clamp(240px, 24vw, 370px);
    height: calc(100vh - 4rem);
    background: white;
    border-radius: 1rem;
    box-shadow: 4px 0 6px rgba(0, 0, 0, 0.1);
    padding: clamp(0.5rem, 1vw, 1rem);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-image-container {
    width: 100%;
    height: 172px;
    background: transparent;
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

.sidebar-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 1rem;
    background-color: #f8fafc;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1rem;
    gap: 0.5rem;
    color: #64748b;
}

.image-placeholder i {
    font-size: 2rem;
}

.image-placeholder span {
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 992px) {
    .sidebar {
        width: clamp(220px, 20vw, 320px);
    }

    .sidebar-image-container {
        height: 150px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        min-height: 180px;
        flex-direction: row;
        justify-content: space-between;
        padding: clamp(0.75rem, 1vw, 1rem);
        gap: clamp(0.75rem, 1vw, 1rem);
        background: #f8fafc;
        border-radius: 0;
        z-index: 10;
        overflow-y: visible;
    }
    
    .sidebar-image-container {
        height: 129px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        flex-direction: column;
        height: auto;
        min-height: 240px;
        padding: clamp(0.5rem, 0.75vw, 0.75rem);
        gap: clamp(0.5rem, 0.75vw, 0.75rem);
    }

    .sidebar-image-container {
        height: 108px;
    }
} 