/* Design System & CSS Variables */
:root {
    /* Default Dark Theme */
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.6);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #bb86fc;
    --accent-hover: #9965f4;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-border: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --bg-color: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #2d3436;
    --text-muted: #636e72;
    --accent: #0984e3;
    --accent-hover: #74b9ff;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
}

[data-theme="cafe"] {
    --bg-color: #fdf6e3;
    --card-bg: rgba(238, 232, 213, 0.7);
    --text-main: #586e75;
    --text-muted: #93a1a1;
    --accent: #b58900;
    --accent-hover: #cb4b16;
    --shadow: 0 8px 32px 0 rgba(101, 123, 131, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="forest"] {
    --bg-color: #1e2b22;
    --card-bg: rgba(43, 61, 48, 0.6);
    --text-main: #e8f5e9;
    --text-muted: #a5d6a7;
    --accent: #4caf50;
    --accent-hover: #81c784;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

h1 {
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: 1px;
}

.controls-top {
    display: flex;
    gap: 10px;
    width: 100%;
}

select {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    text-align: center;
}

select:hover {
    border-color: var(--accent);
}

.timer-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    transition: all 0.5s ease;
}

.mode-selector {
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.1);
    padding: 5px;
    border-radius: 30px;
}

.mode-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.adjust-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adjust-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.timer-display {
    font-size: 6rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    display: flex;
    align-items: center;
}

.colon {
    margin: 0 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.controls-bottom {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.controls-bottom button {
    flex: 1;
    padding: 15px 0;
    text-align: center;
    white-space: nowrap;
}

button {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px 40px;
    border-radius: 30px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.primary-btn {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.primary-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-muted);
}

.secondary-btn:hover {
    border-color: var(--text-main);
    background-color: rgba(255,255,255,0.05);
}

.secondary-btn.active {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 10px;
}

.privacy-link {
    color: var(--text-muted);
    text-decoration: underline;
    margin-left: 5px;
    transition: color 0.3s;
}

.privacy-link:hover {
    color: var(--text-main);
}

.adsense-banner {
    width: 100%;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px dashed var(--glass-border);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 글로벌 내비게이션 바 (GNB) */
.navbar {
    width: 100%;
    background-color: var(--surface-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--primary-color);
}

/* 포털 바디 및 메인 */
.portal-body {
    background-color: var(--bg-color);
    overflow-x: hidden;
    display: block; /* 기존 body의 flex 덮어쓰기 */
    height: auto;
    align-items: initial;
    justify-content: initial;
}

.portal-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 영웅(Hero) 섹션 */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--bg-color) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.2;
}

.hero-section h1 span {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* 포털 섹션 타이틀 */
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

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

.tool-card {
    background-color: var(--surface-color);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
    border-color: var(--primary-color);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.95rem;
    opacity: 0.7;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.tool-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.coming-soon {
    opacity: 0.6;
    pointer-events: none;
}

.coming-soon-badge {
    position: absolute;
    top: 20px;
    right: -30px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 30px;
    transform: rotate(45deg);
}

/* 뉴스/블로그 리스트 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.news-card {
    background-color: var(--surface-color);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.news-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.news-card p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.news-card .date {
    font-size: 0.8rem;
    opacity: 0.5;
}

/* 모바일 반응형 디자인 (Responsive Design) */
@media (max-width: 768px) {
    /* 네비게이션 바 모바일 최적화 */
    .nav-container {
        flex-direction: column;
        gap: 15px;
        padding: 1rem;
    }
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 영웅 섹션 모바일 최적화 */
    .hero-section {
        padding: 3rem 1rem;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section p {
        font-size: 1rem;
    }
    
    /* 툴 그리드 모바일 최적화 (1열 배치) */
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .tool-card {
        padding: 1.5rem;
    }
    
    /* 타이머 카드 모바일 최적화 (timer.html) */
    .timer-display {
        font-size: 4.5rem;
    }
    .controls-top {
        flex-direction: column;
    }
    .controls-bottom {
        flex-wrap: wrap;
    }
    .controls-bottom button {
        flex: 1 1 100%; /* 버튼이 한 줄씩 차지하도록 */
    }
}

