/* Global Styles */
:root {
    /* 라이트 테마 (기본) */
    --primary-color: #6e4dff;
    --secondary-color: #9f84ff;
    --background-color: #f5f5f8;
    --card-background: #ffffff;
    --card-hover-background: #f0f0f5;
    --text-color: #333340;
    --text-secondary: #666680;
    --accent-color: #ff5a9e;
    --hot-color: #ff3a5e;
    --button-gradient: linear-gradient(135deg, #6e4dff, #9f84ff);
    --button-hover-gradient: linear-gradient(135deg, #FEE500, #F6D000);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    --hero-background: #e8e0ff;
    --balt-challenge-color: #ff9d00;
    --navbar-background: rgba(255, 255, 255, 0.95);
    --navbar-border: rgba(138, 110, 255, 0.2);
    --theme-transition: all 0.3s ease;
}

/* 다크 테마 */
.dark {
    --primary-color: #8e6dff;
    --secondary-color: #af94ff;
    --background-color: #1a1a22;
    --card-background: #252532;
    --card-hover-background: #2c2c3a;
    --text-color: #e0e0e8;
    --text-secondary: #a0a0b0;
    --accent-color: #ff6aae;
    --hot-color: #ff4a6e;
    --button-gradient: linear-gradient(135deg, #8e6dff, #af94ff);
    --button-hover-gradient: linear-gradient(135deg, #FEE500, #F6D000);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --hero-background: #2a2a38;
    --balt-challenge-color: #ffad20;
    --navbar-background: rgba(26, 26, 34, 0.95);
    --navbar-border: rgba(138, 110, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: radial-gradient(circle at top right, rgba(138, 110, 255, 0.05), transparent 60%),
                      radial-gradient(circle at bottom left, rgba(255, 126, 182, 0.05), transparent 60%);
    background-attachment: fixed;
    padding-top: 60px; /* 네비게이션 바 높이만큼 패딩 추가 */
    transition: var(--theme-transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* 인덱스 페이지 전용: 모바일에서 좌우/상단 여백 최소화 및 배경 제거 */
.index-page {
    background: transparent;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* 네비게이션 바 스타일 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--navbar-background);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--navbar-border);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 2rem;
    position: relative;
}

.navbar-left, .navbar-right {
    display: flex;
    align-items: center;
}

.navbar-left {
    gap: 1rem;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: 1rem;
}

.navbar-logo {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.navbar-logo i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.navbar-logo a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-logo a:hover {
    color: var(--primary-color);
}

.navbar-item {
    display: flex;
    align-items: center;
}

.navbar-item i {
    margin-right: 0.5rem;
}

.balt-challenge i {
    color: var(--balt-challenge-color);
}

.balt-challenge a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    font-size: 1.1rem;
}

.balt-challenge a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--balt-challenge-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.balt-challenge a:hover {
    color: var(--balt-challenge-color);
}

.balt-challenge a:hover::after {
    transform: scaleX(1);
}

.useful-gpts i {
    color: var(--primary-color);
}

.useful-gpts a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    font-size: 1.1rem;
}

.useful-gpts a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.useful-gpts a:hover {
    color: var(--primary-color);
}

.useful-gpts a:hover::after {
    transform: scaleX(1);
}

.youtube-menu i {
    color: #FF0000;
}

.youtube-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    font-size: 1.1rem;
}

.youtube-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #FF0000;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.youtube-menu a:hover {
    color: #FF0000;
}

.youtube-menu a:hover::after {
    transform: scaleX(1);
}

.overseas-shorts i {
    color: #00BFFF; /* 밝은 하늘색 */
}

.overseas-shorts a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    font-size: 1.1rem;
}

.overseas-shorts a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #00BFFF; /* 밝은 하늘색 */
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.overseas-shorts a:hover {
    color: #00BFFF; /* 밝은 하늘색 */
}

.overseas-shorts a:hover::after {
    transform: scaleX(1);
}

.kakao-login-btn, .kakao-logout-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.kakao-login-btn {
    background-color: #FEE500;
    color: #000000;
}

.kakao-login-btn:hover {
    background-color: #F6D000;
    transform: translateY(-2px);
}

.kakao-logout-btn {
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
}

.kakao-logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.kakao-login-btn i, .kakao-logout-btn i {
    margin-right: 0.4rem;
}

#login-message {
    margin-right: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#mobile-login-message {
    margin-right: 1rem;
    color: var(--text-color);
}

/* 모바일 메뉴 토글 버튼 */
.mobile-menu-toggle {
    display: none;
    font-size: 1.3rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

/* 모바일 메뉴 스타일 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: var(--navbar-background);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0;
    z-index: 999;
    border-top: 1px solid var(--navbar-border);
    backdrop-filter: blur(10px);
}

.mobile-menu-item {
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(138, 110, 255, 0.05);
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

.mobile-menu-item i {
    margin-right: 1rem;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.mobile-menu-item a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    width: 100%;
}

.theme-toggle-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-toggle-mobile span {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: rgba(138, 110, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.dark .toggle-switch {
    background-color: var(--primary-color);
}

.dark .toggle-slider {
    transform: translateX(20px);
}

.mobile-logout-btn {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
}

.mobile-logout-btn i {
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

.mobile-auth {
    justify-content: flex-end;
}

/* 반응형 스타일 수정 */
@media (max-width: 992px) {
    .navbar-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .container {
        padding: 1rem;
    }

    .tool-cards {
        grid-template-columns: 1fr;
    }

    .challenge-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .navbar-container {
        padding: 0 1rem;
    }

    .challenge-header {
        flex-direction: column;
        text-align: center;
    }

    .challenge-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .challenge-title h1 {
        font-size: 1.8rem;
    }

    .challenge-title p {
        font-size: 0.9rem;
    }

    .hero-banner {
        flex-direction: row;
        text-align: left;
        padding: 0.7rem 1rem;
    }

    .hero-icon {
        margin-right: 0.8rem;
    }

    .hero-content {
        text-align: left;
    }

    .hero-description {
        max-width: 100%;
        margin: 0;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .challenge-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .tool-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1201px) {
    .challenge-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .tool-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Hero Banner */
.hero-banner {
    background-color: var(--hero-background);
    border-radius: 16px;
    padding: 0.7rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(138, 110, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    border-radius: 16px;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hero-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-right: 1rem;
    background: rgba(138, 110, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hero-content {
    text-align: left;
    z-index: 1;
    flex: 1;
}

.hero-title {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 100%;
    word-break: keep-all;
    line-height: 1.5;
}

/* Section Divider */
.section-divider-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
    position: relative;
}

.divider-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin-bottom: 1.5rem;
}

.divider-content-line {
    text-align: center;
    background-color: var(--background-color);
    padding: 0 2rem;
    z-index: 1;
    max-width: 80%;
}

.divider-content-line h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.divider-content-line p {
    color: var(--text-secondary);
    font-size: 1rem;
    word-break: keep-all;
    line-height: 1.7;
}

/* Tools Container */
.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tool-card {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(138, 110, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(110, 77, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.tool-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    min-height: 40px;
}

.button-container {
    display: flex;
    justify-content: flex-start;
    margin-top: auto;
}

.action-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--button-gradient);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #FEE500, #FFD700);
    transition: all 0.4s cubic-bezier(0.42, 0, 0.58, 1);
    z-index: -1;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(254, 229, 0, 0.4);
    color: #3A1D1F;
}

.action-button:hover::before {
    left: 0;
}

.hot-tag {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff3a5e;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0 10px 0 10px;
}

.hot-tag.ebook {
    background-color: #27ae60;
}

.hot-tag.new {
    background-color: #3498db;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .index-page {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .tools-container {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }

    .hero-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-description {
        max-width: 100%;
    }

    .divider-content-line {
        max-width: 100%;
    }

    /* 네비게이션 바 반응형 스타일 */
    .navbar-menu {
        display: none;
    }

    .navbar-right {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    /* 네비게이션 바 모바일 스타일 */
    .navbar-container {
        padding: 0 1rem;
    }

    .navbar-logo {
        font-size: 1rem;
    }

    .navbar-logo a {
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 발트 챌린지 페이지 스타일 */
.challenge-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.dark-container {
    background-color: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.challenge-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(138, 110, 255, 0.1);
}

.challenge-icon {
    width: 80px;
    height: 80px;
    background-color: #6e4dff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
}

.challenge-icon i {
    font-size: 2.5rem;
    color: white;
}

.challenge-title h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.challenge-title p {
    color: var(--text-secondary);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .challenge-title p {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* 챌린지 폼 스타일 */
.challenge-form-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.challenge-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.form-group input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(110, 77, 255, 0.2);
}

.form-group small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.required {
    color: #ff6b6b;
    margin-left: 0.2rem;
}

.verification-options {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1.5rem;
}

.option-header {
    margin-bottom: 1rem;
}

.option-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.option-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.verification-tabs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.8rem 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn i {
    font-size: 1rem;
}

.tab-content {
    padding-top: 1rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.challenge-submit-btn {
    background: var(--button-gradient);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.challenge-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 77, 255, 0.3);
}

.challenge-info {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.challenge-info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.challenge-info ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.challenge-info li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.back-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.back-link:hover {
    color: var(--primary-color-dark);
}

.back-link i {
    margin-right: 0.5rem;
}

/* 모달 스타일 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-background);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--card-shadow);
    animation: modalFadeIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    color: #ff6b6b;
}

.modal-header h3 i {
    margin-right: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-info {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.modal-info ul {
    margin: 0;
    padding-left: 1.5rem;
}

.modal-info li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none;
}

/* 알림창 스타일 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-dismissible {
    padding-right: 4rem;
    position: relative;
}

.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1rem;
    color: inherit;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    cursor: pointer;
}

.fade {
    transition: opacity 0.15s linear;
}

.fade.show {
    opacity: 1;
}

/* 다크 모드에서의 알림창 스타일 */
.dark-mode .alert-danger {
    color: #f8d7da;
    background-color: #721c24;
    border-color: #f5c6cb;
}

/* 라이트 테마 대응 */
.light .challenge-form-container {
    background-color: rgba(0, 0, 0, 0.03);
}

.light .verification-options {
    background-color: rgba(0, 0, 0, 0.02);
}

.light .challenge-info {
    background-color: rgba(0, 0, 0, 0.03);
}

.light .form-group input {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light .modal-info {
    background-color: rgba(0, 0, 0, 0.03);
}

.light .tab-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.light .challenge-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 발트 챌린지 페이지 스타일 */
.challenge-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .challenge-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .challenge-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1201px) {
    .challenge-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.challenge-card {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(138, 110, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

/* 인덱스 상단 카드 기본 배경: 하얀색으로 변경 */
.index-page .challenge-cards .challenge-card:first-child {
    background: #ffffff;
    border: 1px solid rgba(138, 110, 255, 0.1);
    position: relative;
    overflow: hidden;
}
.index-page .challenge-cards .challenge-card:first-child .challenge-card-content h2,
.index-page .challenge-cards .challenge-card:first-child .challenge-card-content p { color: var(--text-color); }

/* 모바일 진입 시 첫 카드: 크기 변화 없이 움직이는 조명 효과 + 버튼 컬러 */
@media (max-width: 768px) {
    .challenge-cards .challenge-card:first-child {
        position: relative;
    }
    /* 항상 동작하는 첫 카드 배경 조명 (모바일 외 모든 화면) */
    .index-page .challenge-cards .challenge-card:first-child::before {
        content: '';
        position: absolute;
        top: -20%;
        left: -20%;
        width: 140%;
        height: 140%;
        background:
            radial-gradient(60% 60% at 20% 40%, rgba(255,255,255,0.45), transparent 55%),
            radial-gradient(45% 45% at 80% 60%, rgba(255,255,255,0.30), transparent 55%);
        filter: blur(24px);
        pointer-events: none;
        z-index: 0;
        animation: movingGlow 4s ease-in-out infinite;
    }
    /* 퍼지는 조명(라디얼 펄스) - 크기 변화 없이 뒤쪽에서 퍼짐 */
    .challenge-cards .challenge-card:first-child::after {
        content: '';
        position: absolute;
        inset: -10%;
        background:
            radial-gradient(circle at 50% 50%, rgba(255,255,255,0.45), rgba(255,255,255,0) 55%),
            linear-gradient(115deg, rgba(255,255,255,0), rgba(255,255,255,0.38) 50%, rgba(255,255,255,0) 80%);
        background-size: auto, 200% 200%;
        background-position: center, -150% -150%;
        filter: blur(26px);
        pointer-events: none;
        z-index: 0;
        mix-blend-mode: screen;
        animation: pulseGlow 4s ease-in-out infinite, sweepLight 4.5s ease-in-out infinite;
    }
    /* 내용은 조명 위로 보이도록 */
    .challenge-cards .challenge-card:first-child .challenge-card-content,
    .challenge-cards .challenge-card:first-child .challenge-card-icon { position: relative; z-index: 1; }
    /* 첫 카드 배지 위치: NEW 배지와 동일하게 모서리에 고정(절대배치 유지) */
    .challenge-cards .challenge-card:first-child .challenge-card-badge { position: absolute; top: 0; right: 0; border-radius: 0 10px 0 10px; z-index: 2; }

    /* 버튼 컬러: 기본 노란색, 호버 흰색 */
    .index-page .challenge-cards .challenge-card:first-child .challenge-card-button {
        background: #FEE500;
        color: #000000;
        transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    }
    .index-page .challenge-cards .challenge-card:first-child .challenge-card-button:hover {
        background: #ffffff;
        color: #3A1D1F;
        box-shadow: 0 6px 18px rgba(255,255,255,0.25);
    }
}

@keyframes softPulse {
    0% { box-shadow: 0 0 0 rgba(110,77,255,0); }
    25% { box-shadow: 0 14px 40px rgba(110,77,255,0.38); }
    55% { box-shadow: 0 18px 48px rgba(110,77,255,0.32); }
    80% { box-shadow: 0 12px 36px rgba(110,77,255,0.22); }
    100% { box-shadow: var(--card-shadow); }
}

@keyframes glowSweep {
    0% { opacity: 0; }
    15% { opacity: 1; }
    70% { opacity: 0.6; }
    100% { opacity: 0; }
}

@keyframes movingGlow {
    0% { transform: translateX(-6%) translateY(0%); }
    50% { transform: translateX(6%) translateY(-2%); }
    100% { transform: translateX(-6%) translateY(0%); }
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.25; }
    50% { transform: scale(1.15); opacity: 0.55; }
    100% { transform: scale(0.9); opacity: 0.25; }
}

@keyframes sweepLight {
    0% { background-position: center, -150% -150%; }
    50% { background-position: center, 0% 0%; }
    100% { background-position: center, 150% 150%; }
}

/* 두번째, 세번째 카드 배지 색상 보라색으로 통일 */
.index-page .challenge-cards .challenge-card:nth-child(2) .challenge-card-badge,
.index-page .challenge-cards .challenge-card:nth-child(3) .challenge-card-badge {
    background-color: var(--primary-color);
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.challenge-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(110, 77, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.challenge-card-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.challenge-card-content h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.challenge-card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.challenge-card-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--button-gradient);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.challenge-card-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #FEE500, #FFD700);
    transition: all 0.4s cubic-bezier(0.42, 0, 0.58, 1);
    z-index: -1;
}

.challenge-card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(254, 229, 0, 0.4);
    color: #3A1D1F;
}

.challenge-card-button:hover::before {
    left: 0;
}

.challenge-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff3a5e;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0 10px 0 10px;
}

/* 알림 스타일 */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.2);
    border-left: 3px solid #27ae60;
    color: #2ecc71;
}

.alert-warning {
    background-color: rgba(241, 196, 15, 0.2);
    border-left: 3px solid #f1c40f;
    color: #f39c12;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.2);
    border-left: 3px solid #e74c3c;
    color: #e74c3c;
}

.alert-error {
    background-color: rgba(231, 76, 60, 0.2);
    border-left: 3px solid #e74c3c;
    color: #e74c3c;
}

/* 라이트 테마 대응 */
.light .challenge-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light .challenge-card-icon {
    background-color: rgba(110, 77, 255, 0.1);
}

.light .challenge-card-content h2 {
    color: var(--text-color);
}

.light .challenge-card-content p {
    color: var(--text-secondary);
}

.light .alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.light .alert-warning {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f39c12;
}

.light .alert-danger,
.light .alert-error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* 테마 토글 스타일 */
.theme-toggle {
    margin-right: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 30px;
    height: 30px;
}

.theme-toggle .dark-icon,
.theme-toggle .light-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.light .dark-icon {
    opacity: 1;
    transform: scale(1);
}

.light .light-icon {
    opacity: 0;
    transform: scale(0);
}

.dark .dark-icon {
    opacity: 0;
    transform: scale(0);
}

.dark .light-icon {
    opacity: 1;
    transform: scale(1);
}

/* 발트 챌린지 스타일 카드 및 컨테이너 */
.challenge-container {
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    background-color: var(--card-background);
    box-shadow: var(--card-shadow);
}

.dark-container {
    background-color: var(--card-background);
}

.challenge-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.challenge-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(110, 77, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
}

.challenge-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.challenge-title h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.challenge-title p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 700px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .challenge-title p {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

.challenge-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.challenge-card {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(138, 110, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.challenge-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(110, 77, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.challenge-card-icon i {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.challenge-card-content h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.challenge-card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    min-height: 60px;
}

.challenge-card-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--button-gradient);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.challenge-card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 77, 255, 0.3);
}

.challenge-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff3a5e;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0 10px 0 10px;
}

.challenge-card-badge.closed {
    background-color: #7f8c8d;
}

.challenge-card-badge.new {
    background-color: #3498db;
}

.challenge-card-badge.ebook {
    background-color: #27ae60;
}

/* 전자책 테이블 */
.ebook-table-wrapper {
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.ebook-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
    border-radius: 10px;
    overflow: hidden;
}

.ebook-table thead th {
    text-align: left;
    background: rgba(110, 77, 255, 0.08);
    color: var(--text-color);
    font-weight: 600;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.ebook-table tbody td {
    padding: 10px 12px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(138, 110, 255, 0.12);
    font-size: 0.9rem;
}

.ebook-table tbody tr:hover {
    background-color: var(--card-hover-background);
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .challenge-header {
        flex-direction: column;
        text-align: center;
    }

    .challenge-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .challenge-cards {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .challenge-card-content p {
        min-height: auto;
    }
    /* 인덱스 페이지: 직사각형 가로형 카드로 컴팩트하게 */
    .index-page .challenge-container,
    .index-page .dark-container { padding: 0.5rem; background: transparent; box-shadow: none; border-radius: 0; }
    .index-page .challenge-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; }
    .index-page .challenge-card-icon { width: 44px; height: 44px; margin-bottom: 0; }
    .index-page .challenge-card-content h2 { font-size: 1.1rem; margin-bottom: 0.2rem; }
    .index-page .challenge-card-content p { font-size: 0.85rem; margin-bottom: 0.5rem; min-height: auto; }
    .index-page .challenge-card-button { padding: 0.45rem 0.85rem; font-size: 0.85rem; white-space: nowrap; }
}

/* 버튼 중앙 정렬 적용 (모든 카드) -> 원래대로 복원 */
.challenge-card .challenge-card-button {
    display: inline-block;
    width: auto;
    margin: 0;
}

/* 첫 카드 전구 아이콘 깜빡임 */
.index-page .challenge-cards .challenge-card:first-child .challenge-card-icon {
    animation: bulbPulse 1.4s ease-in-out infinite;
    background-color: rgba(110,77,255,0.10);
}
.index-page .challenge-cards .challenge-card:first-child .challenge-card-icon i {
    color: var(--primary-color);
    text-shadow: none;
}
@keyframes bulbPulse {
    0% { box-shadow: 0 0 0 rgba(110,77,255,0); transform: scale(1); }
    50% { box-shadow: 0 0 18px rgba(110,77,255,0.55); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 rgba(110,77,255,0); transform: scale(1); }
}

/* 첫 카드 텍스트 대비 고정 (흰색) */
.index-page .challenge-cards .challenge-card:first-child .challenge-card-content h2,
.index-page .challenge-cards .challenge-card:first-child .challenge-card-content p { color: #000000; }

/* 첫 카드 배경 애니메이션 제거 (전구 아이콘만 깜빡임 유지) */
.index-page .challenge-cards .challenge-card:first-child::before,
.index-page .challenge-cards .challenge-card:first-child::after {
    content: none !important;
    animation: none !important;
}
