/* 마이페이지, 메인페이지 공통 */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #9ED8A0; /* 연두색 배경 변경전 - #98c89a */
}

header {
    background-color: #eef0d4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
}

.logo {
    height: 50px;
}

.menu-buttons button {
    background-color: #c8e6a2;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.menu-buttons button:hover {
    background-color: #b1d98a;
}

.quiz-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    padding: 40px 60px;
}

.quiz-card:hover {
    transform: scale(1.03);
}

.quiz-thumbnail {
    flex: 1;
    background-color: #dcdcdc; /* 기본 회색 배경 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.quiz-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.quiz-info {
    position: relative;
    padding: 10px;
    height: 120px; /* 고정 높이로 레이아웃 정렬 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.quiz-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.quiz-desc {
    font-size: 14px;
    color: #333;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 5px;
    max-height: 36px; /* 두 줄 정도 보이게 제한 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-date {
    font-size: 12px;
    color: #999;
}

.quiz-info .icon {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 30px;
    height: 30px;
}

.icon {
    width: 20px;
    height: 20px;
    margin-top: 4px;
}
/* 아이콘을 텍스트위치에 배치할 때 사용 */
.quiz-desc {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #333;
}

.icon-left {
    width: 24px;
    height: 24px;
}

.icon-right {
    width: 24px;
    height: 24px;
}

.quiz-desc-text {
    font-size: 0.85em;
    color: #333;
}


/* 공지사항 게시판 CSS */
.notice-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 60px;
    background-color: #98c89a;
}

.notice-item {
    background-color: #eef0d4;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.notice-item:hover {
    background-color: #e0e5bb;
}

.notice-title {
    font-size: 1rem;
}

.notice-date {
    font-size: 0.9rem;
    color: #555;
}

.notice-detail-container {
    background-color: #98c89a;
    padding: 40px 60px;
}

.notice-detail-header {
    display: flex;
    justify-content: space-between;
    background-color: #eef0d4;
    padding: 15px 20px;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 20px;
}

.notice-content {
    background-color: #eef0d4;
    padding: 40px;
    height: 300px;
    border-radius: 5px;
}

.notice-back {
    margin-top: 30px;
    text-align: center;
}

.notice-back button {
    background-color: #eef0d4;
    padding: 10px 20px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

/* 공지사항 작성 , 수정*/
.notice-form-container {
    background-color: #98c89a;
    padding: 40px 60px;
}

.notice-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: #eef0d4;
}

.notice-textarea {
    width: 100%;
    height: 250px;
    padding: 15px;
    font-size: 1rem;
    resize: none;
    border: none;
    border-radius: 5px;
    background-color: #eef0d4;
}

.notice-form-buttons {
    margin-top: 20px;
    text-align: center;
}

.notice-form-buttons button {
    background-color: #eef0d4;
    padding: 10px 20px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    margin: 0 10px;
    border-radius: 5px;
}
/* 페이징 버튼 스타일 */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    margin: 0 5px;
    text-decoration: none;
    color: blue;
    cursor: pointer;
}

.pagination span {
    margin: 0 5px;
}

/* 경고창 스타일 */
/* 전체 팝업 배경 */
#customAlert {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.4);
    display: none; /* 초기에 안 보이도록 */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 팝업 박스 */
.alert-box {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
    max-width: 90vw;
}

/* 팝업 나타나는 애니메이션 */
#customAlert.show .alert-box {
    opacity: 1;
    transform: scale(1);
}

.alert-box button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #48aa78;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.alert-box button:hover {
    background-color: #37986c;
}

/* ===== 커스텀 프롬프트 영역 ===== */
#customPrompt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.prompt-box {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
    max-width: 90vw;
}

/* 나타나는 애니메이션 */
#customPrompt.show .prompt-box {
    opacity: 1;
    transform: scale(1);
}

/* 버튼 스타일 (알림과 동일) */
.prompt-box button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #48aa78;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.prompt-box button:hover {
    background-color: #37986c;
}

/* 입력창 스타일 */
.prompt-box input {
    width: 80%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}


/* 회원가입 페이지 공통 */
.register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #98c89a;
    height: 100vh;
}

.register-form {
    background-color: #eef0d4;
    padding: 40px;
    border-radius: 10px;
    width: 350px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.register-logo {
    text-align: center;
    margin-bottom: 20px;
}

.register-logo img {
    width: 50px;
    height: 50px;
}

.register-title {
    text-align: left;
    margin-bottom: 20px;
}

.register-label {
    font-weight: bold;
    color: #4CAF50;
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
}

.register-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    background-color: white;
}

.register-id-group {
    display: flex;
    gap: 10px;
}

.register-btn-small {
    padding: 10px;
    background-color: #c8e6a2;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.register-btn-submit {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background-color: #8bc34a;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.register-footer {
    margin-top: 20px;
    font-size: 0.85em;
    text-align: center;
}
.login-container {
    background-color: #98c89a;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 로그인 스타일 */
.login-box {
    background-color: #eef0d4;
    padding: 40px;
    border-radius: 10px;
    width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    height: 60px;
    margin-bottom: 20px;
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #222;
}

.login-label {
    align-self: flex-start;
    margin: 10px 0 5px;
    font-size: 0.95rem;
    color: #37986c;
    font-weight: bold;
}

.login-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background-color: white;
    margin-bottom: 10px;
    font-size: 1rem;
}

.login-button {
    width: 100%;
    padding: 12px;
    background-color: #7dbf69;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

.login-button:hover {
    background-color: #68aa58;
}

.login-footer {
    font-size: 0.85rem;
    margin-top: 15px;
    color: #333;
    text-align: center;
}

.login-footer a {
    color: #2d7043;
    text-decoration: none;
    margin-left: 5px;
}


/* Dim 배경 */
#popupContainer {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 작은 크기의 팝업 */
#popupContent {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 825px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
/* 커스텀 팝업 레이아웃 */
.modal-layout {
    width: 90%;
    max-width: none;
    height: auto;
    margin: 50px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 40px 60px;
}

.image-preview-section {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 30px;
}

/* 이미지 박스 고정 크기 및 미리보기 일관성 */
.image-box {
    width: 400px;  /* 원하는 고정 너비 */
    height: 225px; /* 원하는 고정 높이 (16:9 비율 예시) */
    border: 1px solid #ddd;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    background: #f9f9f9;
}

/* 이미지 크기 유지 및 박스 내 맞춤 */
.image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 비율 유지하며 박스에 맞추기 */
}

/* 자르기 버튼 고정 위치 */
#cropButton {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: none; /* 초기 숨김, JS에서 보여줌 */
}

/* 파일 선택과 정답 입력 간격 조정 */
.image-section + .button-group {
    margin-top: 20px;
}

.button-group,
.modal-footer {
    text-align: center;
    margin-top: 30px;
}

.answer-list span {
    display: inline-block;
    background: #eee;
    border-radius: 12px;
    padding: 8px 16px;
    margin: 5px;
    font-size: 16px;
}

input#answerInput {
    width: 90%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
}
.thumbnail-preview img {
    max-width: 100px;
    max-height: 100px;
    margin-top: 10px;
}

/* 오디오 퀴즈 - 유튜브 플레이어 컨테이너 */
.audio-player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

/* 시간 설정 버튼 */
.time-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.time-buttons button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background-color: #c8e6a2;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.time-buttons button:hover {
    background-color: #b1d98a;
}

/* 시간 표시 */
.time-display {
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
}
/* 팝업 닫기 버튼 */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}
/* 정답 리스트 */
.answer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #eef0d4;
    border-radius: 6px;
}

.answer-item .remove-btn {
    color: red;
    font-weight: bold;
    cursor: pointer;
}

.delete-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
}

/*  퀴즈 편집용 문제 카드 (이미지 전용) */
.quiz-card.edit-card {
    width: 200px;
    height: 250px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.quiz-card.edit-card .quiz-thumbnail {
    width: 100%;
    height: 100%;
}

.quiz-card.edit-card .quiz-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quiz-card.edit-card .delete-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: white;
    border: none;
    border-radius: 50%;
    padding: 4px 7px;
    font-size: 14px;
    cursor: pointer;
    z-index: 2;
}

/* 메인/마이페이지 카드 (.quiz-card) 기존 그대로 유지 */
.quiz-card {
    width: 200px;
    height: auto;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
    margin: 10px;
    display: inline-block;
    vertical-align: top;
}

.quiz-card .quiz-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.quiz-card .quiz-info {
    padding: 10px;
}

.quiz-title {
    font-size: 16px;
    font-weight: bold;
}

.quiz-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    max-height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-date {
    font-size: 12px;
    color: #999;
}

.quiz-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.quiz-thumb {
    width: 100%;
    height: auto;
}
