:root {
    /* Design Tokens extracted from Personal Stylist Studio */
    --primary-color: #135bec;
    --primary-hover: #0d47a1;
    --accent-color: #0ea5e9;
    
    --text-main: #111318;
    --text-muted: #616f89;
    
    --bg-color: #f6f6f8;
    --card-bg: #ffffff;
    
    /* Re-purposing glass variables for clean borders/shadows */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: #e0e5f0;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    --font-family: 'Plus Jakarta Sans', 'Noto Sans KR', sans-serif;
    
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
}

body.dark-mode {
    --bg-color: #111318;
    --card-bg: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    
    --glass-bg: rgba(31, 41, 55, 0.95);
    --glass-border: #374151;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
}

/* Language Visibility Logic */
body.lang-ko .lang-en { display: none !important; }
body.lang-en .lang-ko { display: none !important; }

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

body {
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-color);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased; /* Crisp text */
}

/* Subtle background pattern/gradient instead of moving gradient */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(19, 91, 236, 0.05) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
}

/* Glass Wrapper (Main Layout) -> Layout Wrapper */
.glass-wrapper {
    max-width: 1200px; /* Increased from 900px */
    margin: 40px auto;
    padding: 2rem;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Top Brand (Flag & Logo) */
.top-brand {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    cursor: default;
}

.brand-flag-img {
    width: 28px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: block;
}

.brand-text {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0.05em;
}

/* Top Utilities (Theme & Lang Toggles) */
.top-utils {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 2000;
}

.toggle-group {
    display: flex;
    background: var(--card-bg);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.toggle-opt {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    border-radius: 8px;
}

.toggle-opt.active {
    color: white;
}

.toggle-group .slider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background: var(--primary-color);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Specific state for theme/lang sliders */
body.dark-mode .theme-switcher .slider {
    transform: translateX(100%);
}

body.lang-en .lang-switcher .slider {
    transform: translateX(100%);
}

body.dark-mode .toggle-group {
    background: rgba(31, 41, 55, 0.8);
}

/* Responsive Top Utils */
@media (max-width: 768px) {
    /* Fix Top Brand overlap on mobile */
    .top-brand {
        position: relative;
        top: 0;
        left: 0;
        justify-content: center;
        margin: 10px auto;
        width: fit-content;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .top-utils {
        position: relative;
        top: 0;
        right: 0;
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 20px;
    }
}

/* Header Adjustments */
.site-header {
    display: flex;
    justify-content: center; /* Center navigation */
    align-items: center;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1000;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item-with-dropdown {
    position: relative; /* 드롭다운의 기준점이 됨 */
}

.site-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0.5rem;
    display: block;
}

.site-nav a:hover {
    color: var(--primary-color);
}

/* Sub Navigation for Tour - Floating Dropdown Style */
.sub-nav {
    display: none;
    position: absolute;
    top: calc(100% + 15px); /* 부모 li 바로 아래 */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    min-width: 160px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sub-nav.show {
    display: block !important;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.sub-nav ul {
    display: flex;
    flex-direction: column; /* 세로 나열 */
    list-style: none;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.sub-nav a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    background: transparent;
    transition: all 0.2s ease;
}

.sub-nav a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    transform: scale(1.02);
}

/* 기존 드롭다운 하단 여백 제거를 위해 */
@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Generator Controls Enhanced */
.generator-controls {
    display: flex;
    flex-direction: column;
    gap: 3rem; /* 여백을 더 넓게 조정 */
    padding-top: 1rem;
}

.intro-section {
    text-align: left;
    margin-bottom: 1rem;
}

.creative-intro {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.creative-intro .line-1 {
    opacity: 0.8;
    font-size: 0.7em;
    font-weight: 600;
    color: var(--text-muted);
}

.creative-intro .highlight {
    position: relative;
    color: var(--primary-color);
    display: inline-block;
}

.creative-intro .highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 12px;
    background: rgba(19, 91, 236, 0.1);
    z-index: -1;
    border-radius: 4px;
}

.sub-intro {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-weight: 500;
}

.options-container {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

.option-group {
    flex: 1;
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.option-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    border-color: rgba(19, 91, 236, 0.2);
}

.option-label {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-main);
}

.option-label .icon {
    font-size: 1.2rem;
}

/* Selector Buttons - 2x2 Grid */
.duration-selector, 
.companion-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.duration-btn,
.companion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    border: 2px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon {
    font-size: 1.2rem;
}

.duration-btn:hover,
.companion-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(19, 91, 236, 0.02);
}

.duration-btn.active,
.companion-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(19, 91, 236, 0.25);
    transform: translateY(-2px);
}

/* Main Generate Button */
#generate-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    font-size: 1.25rem;
    padding: 20px 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 25px rgba(19, 91, 236, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 1rem;
}

#generate-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(19, 91, 236, 0.45);
}

#generate-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: all 0.6s;
}

#generate-btn:hover .btn-shine {
    left: 100%;
    transition: all 0.6s;
}

@media (min-width: 600px) {
    .duration-btn,
    .companion-btn {
        flex: 1; /* Auto width on larger screens */
    }
}

.generator-display {
    background: var(--bg-color);
    border-radius: var(--radius-2xl);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--glass-border);
    transition: all 0.3s ease;
}

/* When result is shown, remove dashed border style (optional, handled by content) */
.generator-display:has(.result-card-container) {
    background: transparent;
    border: none;
    display: block;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    padding: 2rem;
}

/* Desktop Grid */
@media (min-width: 900px) {
    .generator-layout {
        grid-template-columns: 1fr 1fr; /* 50% 50% split */
        gap: 4rem;
    }
    
    .generator-display {
        position: sticky;
        top: 2rem;
    }
}

/* Buttons */
.duration-selector, 
.companion-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.duration-btn,
.companion-btn {
    padding: 12px 24px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: 9999px; /* Pill shape */
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.duration-btn:hover,
.companion-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-color);
    transform: translateY(-1px);
}

.duration-btn.active,
.companion-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(19, 91, 236, 0.3); /* Primary shadow */
    transform: translateY(-1px);
}

#generate-btn {
    font-size: 1.1rem;
    padding: 18px 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(19, 91, 236, 0.25);
    transition: all 0.2s ease;
    margin-bottom: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#generate-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(19, 91, 236, 0.35);
}

/* Result Area - ENHANCED & UNIFIED */
#result {
    min-height: 100px;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

#result.show {
    opacity: 1;
    transform: translateY(0);
}

.result-card-container {
    background: var(--card-bg);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Split Layout */
.result-card-container.split-layout {
    flex-direction: row; /* Desktop side-by-side */
    min-height: 400px;
    padding: 0; /* Remove internal padding to allow full-bleed sides */
}

.result-map-side {
    flex: 1.2;
    background: var(--bg-color);
    border-right: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.map-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.map-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.result-info-side {
    flex: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.info-top-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
}

.result-city-name {
    font-size: clamp(2rem, 6vw, 3.5rem); /* 크기를 시원하게 키움 */
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900; /* 더 굵게 강조 */
    margin: 0;
    letter-spacing: -0.04em;
    white-space: nowrap;
    line-height: 1.2;
}


.result-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(19, 91, 236, 0.08); /* Primary alpha */
    color: var(--primary-color);
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(19, 91, 236, 0.1);
}

.result-summary-box {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    text-align: left;
    border: 1px solid var(--glass-border);
}

/* Map Container Style */
#map {
    width: 100%;
    height: 350px;
    border-radius: var(--radius-xl);
    margin: 1.5rem 0;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.search-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    background: #03c75a; /* Naver Green */
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(3, 199, 90, 0.2);
    transition: all 0.2s ease;
    font-size: 1.05rem;
}

.search-link:hover {
    background: #02b350;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(3, 199, 90, 0.3);
}

.result-actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* 가로 중앙 정렬 */
    justify-content: center;
    margin-top: 2.5rem;
    width: 100%;
}

.result-actions {
    display: flex;
    justify-content: center; /* 버튼들 자체도 중앙으로 */
    gap: 12px;
    width: 100%;
    max-width: 550px;
}

.share-btn {
    flex: 1; /* 너비 비율 확대 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1, #a855f7); /* Indigo to Purple */
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap; /* 글자 줄바꿈 방지 */
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    opacity: 0.9;
}

.share-btn:active {
    transform: translateY(0);
}

@media (max-width: 500px) {
    .result-actions {
        flex-direction: column;
    }
    .share-btn {
        flex: 1;
    }
}

/* About Page Improvements */
.about-intro {
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Hero Title */
.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 2rem;
    letter-spacing: -0.05em;
    line-height: 1.1;
    display: block;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(19, 91, 236, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

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

/* Roulette Text Animation */
.roulette-text {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    text-align: center;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 3rem 0;
    filter: blur(0.5px); /* 속도감 표현 */
    animation: roulettePulse 0.1s infinite;
}

@keyframes roulettePulse {
    0% { transform: scale(0.98); opacity: 0.8; }
    50% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(0.98); opacity: 0.8; }
}

/* Board Layout (Parallel) */
.board-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.board-form-side {
    flex: 1;
    position: sticky;
    top: 2rem;
}

.board-list-side {
    flex: 1.5;
}

/* Modern Input Card */
.input-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05); /* Softer, floaty shadow */
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.input-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px -12px rgba(0,0,0,0.1);
}

/* Add a subtle top gradient accent */
.input-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0.7;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.guestbook-input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--glass-border);
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
    outline: none;
    background: var(--card-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(19, 91, 236, 0.1);
}

.guestbook-form textarea {
    resize: vertical;
    min-height: 120px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}

.guestbook-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 9999px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(19, 91, 236, 0.2);
    transition: all 0.3s ease;
}

.guestbook-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(19, 91, 236, 0.3);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 10px 18px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    color: var(--text-muted);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-weight: 700;
    color: var(--text-main);
}

@media (max-width: 1000px) {
    .board-layout {
        flex-direction: column;
    }
    .board-form-side {
        position: static;
        width: 100%;
    }
    .board-list-side {
        width: 100%;
    }
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.message-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    padding-bottom: 2.5rem;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.message-card:hover {
    box-shadow: var(--glass-shadow);
    transform: translateY(-2px);
}

.message-author {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.message-date {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.delete-btn:hover {
    opacity: 1;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626; /* Red error color */
}

/* Footer */
.site-footer-main {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Dark Mode Adjustments */
body.dark-mode .result-card-container {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .result-summary-box {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
}

body.dark-mode .feature-card {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .feature-card:hover {
    background: rgba(30, 41, 59, 0.7);
}

body.dark-mode .guestbook-form input,
body.dark-mode .guestbook-form textarea {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .message-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 900px) {
    .options-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .glass-wrapper {
        margin: 0;
        padding: 1rem;
        min-height: 100vh;
        border-radius: 0;
    }

    .container {
        padding: 2rem 1.5rem;
    }
    
    .hero-title {
        margin-bottom: 1.5rem;
        /* Flex adjustment for mobile if needed */
        flex-direction: column;
        gap: 10px;
    }

    .site-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .site-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
        font-size: 0.95rem;
    }
    
    .site-nav a {
        display: inline-block;
        padding: 0.5rem; /* Increase touch target */
    }
    
    #theme-toggle {
        margin-left: 0;
    }

    /* Stack Guestbook inputs */
    .guestbook-input-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .guestbook-form {
        width: 100%;
    }
    
    #generate-btn {
        width: 100%;
        padding: 16px;
        font-size: 1.1rem;
    }

    .search-link {
        width: 100%;
        box-sizing: border-box;
    }
    
    .duration-selector, 
    .companion-selector {
        gap: 8px;
    }
    
    .duration-btn,
    .companion-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        flex: 1 1 auto; /* Allow buttons to grow/shrink slightly */
        min-width: 80px; /* Ensure they don't get too small */
    }

    /* Prevent text cutoff on mobile */
    .result-city-name {
        white-space: normal;
        word-break: keep-all;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .hero-title {
        font-size: 2.2rem; /* Ensure it fits on very small screens */
    }
    
    .site-nav ul {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
}
