/* Common Styles for Idol Stage Event Calendar */
/* Sakura (桜) Theme - Japanese Cherry Blossom */

/* Google Fonts — Noto Sans (Latin + Thai + Japanese), weights 400–800 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400..800&family=Noto+Sans+Thai:wght@400..800&family=Noto+Sans+JP:wght@400..800&display=swap');

:root {
    /* === Sakura Core Colors === */
    --sakura-light: #FFB7C5;
    --sakura-medium: #F48FB1;
    --sakura-dark: #E91E63;
    --sakura-deep: #C2185B;
    --sakura-deeper: #880E4F;

    /* === Gradients === */
    --sakura-gradient: linear-gradient(135deg, #FFB7C5 0%, #E91E63 100%);
    --sakura-gradient-hover: linear-gradient(135deg, #F8BBD9 0%, #EC407A 100%);
    --sakura-gradient-soft: linear-gradient(135deg, #FFB7C5 0%, #F48FB1 100%);
    --sakura-gradient-full: linear-gradient(135deg, #FFB7C5 0%, #F48FB1 50%, #E91E63 100%);
    --sakura-gradient-vertical: linear-gradient(180deg, #FFB7C5 0%, #F48FB1 50%, #E91E63 100%);
    --sakura-gradient-pale: linear-gradient(135deg, #fff5f7, #fce4ec);

    /* === Sakura Backgrounds === */
    --sakura-bg: #FFF0F3;
    --sakura-bg-soft: #FFF8F9;
    --sakura-bg-hover: #fef7f9;
    --sakura-bg-medium: #ffe0eb;
    --sakura-bg-dark: #ffd1e0;
    --sakura-border: #FCE4EC;

    /* === Sakura Alpha Variants === */
    --sakura-dark-10: rgba(233, 30, 99, 0.1);
    --sakura-dark-15: rgba(233, 30, 99, 0.15);
    --sakura-dark-18: rgba(233, 30, 99, 0.18);
    --sakura-dark-20: rgba(233, 30, 99, 0.2);
    --sakura-dark-30: rgba(233, 30, 99, 0.3);
    --sakura-dark-40: rgba(233, 30, 99, 0.4);
    --sakura-dark-50: rgba(233, 30, 99, 0.5);
    --sakura-deeper-20: rgba(136, 14, 79, 0.2);

    /* === Text === */
    --text-dark: #4A4A4A;
    --text-light: #6c757d;

    /* === Status Colors === */
    --color-success-bg: #E8F5E9;
    --color-success-text: #2E7D32;
    --color-warning-bg: #FFF3E0;
    --color-warning-text: #E65100;
    --color-error-bg: #ffebee;
    --color-error-text: #c62828;

    /* === Neutral === */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --bg-light: #f8f9fa;
}

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

body {
    font-family: 'Noto Sans', 'Noto Sans Thai', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--sakura-gradient);
    min-height: 100vh;
    padding: 20px;
}

/* Form controls don't inherit font-family by default — force them to use the body font */
input,
textarea,
select,
button {
    font-family: inherit;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--sakura-dark-30);
    overflow: hidden;
}

.container.wide {
    max-width: 1200px;
}

.container.calendar-mode {
    overflow: clip;
}

header {
    background: var(--sakura-gradient);
    color: white;
    padding: 30px;
    /* Shift the whole header down by the device safe-area inset (notch / camera /
       Dynamic Island). The base value also seats the centered title clearly
       below the absolutely-positioned button row (buttons span ~20–58px) so
       they don't feel cramped — both title and buttons move by exactly env(...) */
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
    text-align: center;
    position: relative;
}

/* Header with cover background image */
header.has-site-cover {
    background-image: var(--header-cover-url);
    background-size: cover;
    background-position: center;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn.active {
    background: white;
    color: var(--sakura-dark);
    border-color: white;
}

/* Header Navigation */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.header-nav-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-ticket {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-color: rgba(255,255,255,.4);
    font-weight: 700;
}
.btn-ticket:hover {
    background: linear-gradient(135deg, #e55a24 0%, #e07e10 100%);
    border-color: rgba(255,255,255,.6);
}

h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Site Logo — sits on its own centered line above the page heading */
.site-logo-link {
    display: block;
    text-align: center;
    line-height: 0;
    margin-bottom: 8px;
}

.site-logo {
    width: min(500px, 82vw);
    height: auto;
    max-height: 120px;
    object-fit: contain;
    display: inline-block;
}

@media (max-width: 768px) {
    .site-logo {
        width: min(320px, 78vw);
        height: auto;
        max-height: 80px;
    }
}

/* Content */
.content {
    padding: 40px;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    color: var(--sakura-dark);
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--sakura-medium);
}

.section h3 {
    color: var(--text-dark);
    font-size: 1.2em;
    margin: 20px 0 10px 0;
}

.section p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 15px;
}

.section ul,
.section ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.section li {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 10px;
}

/* Feature Box */
.feature-box {
    background: var(--sakura-bg);
    border-left: 4px solid var(--sakura-dark);
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.feature-box strong {
    color: var(--sakura-dark);
}

/* Contact Box */
.contact-box {
    background: var(--sakura-bg);
    border-left: 4px solid var(--sakura-dark);
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s;
    border: 1px solid var(--sakura-dark-10);
}

.contact-item:hover {
    box-shadow: 0 4px 12px var(--sakura-dark-15);
    transform: translateY(-2px);
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.contact-info h3 {
    color: var(--sakura-dark);
    font-size: 1.1em;
    margin-bottom: 5px;
}

.contact-info p {
    color: var(--text-dark);
    margin: 0;
}

.contact-info a {
    color: var(--sakura-dark);
    text-decoration: none;
    font-weight: 600;
}

.contact-info a:hover {
    text-decoration: underline;
    color: var(--sakura-deep);
}

/* Disclaimer Box */
.disclaimer {
    background: #FFF8E1;
    border-left: 4px solid #FFB300;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.disclaimer strong {
    color: #F57C00;
}

.disclaimer p {
    color: #E65100;
    margin: 0;
}

/* Footer */
footer {
    background: var(--sakura-bg);
    border-top: 2px solid var(--sakura-dark-10);
    padding: 20px;
    text-align: center;
}

.footer-text {
    color: var(--text-light);
    font-size: 0.9em;
}

.footer-version {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    opacity: 0.65;
}

/* Top-left icon button group (all pages) */
.header-top-left {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top, 0px));
    left: calc(20px + env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.home-icon-btn,
.event-picker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.home-icon-btn:hover,
.event-picker-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .header-top-left { top: calc(10px + env(safe-area-inset-top, 0px)); left: calc(10px + env(safe-area-inset-left, 0px)); gap: 6px; }
    .home-icon-btn, .event-picker-btn { width: 34px; height: 34px; }
}

/* Event Picker Overlay */
.event-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 3000;
    padding: 20px;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
}
.event-picker-overlay.active {
    display: flex;
}

/* Event Picker Modal Box */
.event-picker-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.event-picker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--sakura-gradient);
    color: white;
    font-weight: 700;
    font-size: 1.05em;
    flex-shrink: 0;
}
.event-picker-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.event-picker-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Search + Filter Controls */
.event-picker-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.event-picker-search {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 14px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--card-bg, white);
    color: var(--text-primary);
}
.event-picker-search:focus {
    border-color: var(--sakura-medium);
    box-shadow: 0 0 0 3px var(--sakura-dark-10, rgba(233,30,99,0.1));
}
.event-picker-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ep-tab {
    padding: 5px 12px;
    border: 1.5px solid var(--border-light);
    border-radius: 16px;
    background: transparent;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.ep-tab:hover {
    border-color: var(--sakura-medium);
    color: var(--sakura-dark);
}
.ep-tab.active {
    background: var(--sakura-gradient);
    border-color: transparent;
    color: white;
}

/* No results message */
.event-picker-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Card Grid */
.event-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

/* Individual Card */
.event-picker-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.event-picker-card:hover {
    border-color: var(--sakura-medium);
    box-shadow: 0 4px 12px var(--sakura-dark-20);
    text-decoration: none;
}
.event-picker-card.current {
    border-color: var(--sakura-dark);
    background: var(--sakura-bg-hover);
}
.event-picker-current-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.68em;
    font-weight: 700;
    color: var(--sakura-dark);
    background: rgba(233, 30, 99, 0.1);
    padding: 2px 7px;
    border-radius: 8px;
}
.event-picker-card-name {
    font-weight: 700;
    font-size: 0.9em;
    color: var(--text-primary);
    padding-right: 48px;
    line-height: 1.35;
}
.event-picker-card-dates {
    font-size: 0.78em;
    color: var(--text-secondary);
}
.event-picker-card-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    align-self: flex-start;
    margin-top: 2px;
}
.event-picker-card-badge.ongoing  { background: #e8f5e9; color: #2e7d32; }
.event-picker-card-badge.upcoming { background: #e3f2fd; color: #1565c0; }
.event-picker-card-badge.past     { background: #f5f5f5; color: #757575; }

@media (max-width: 768px) {
    /* Slide up from bottom on mobile */
    .event-picker-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .event-picker-modal {
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        max-width: 100%;
    }
    /* Switch grid → list */
    .event-picker-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 8px 12px 12px;
    }
    /*
     * 2-row grid layout per card:
     * col 1 (flex)      | col 2 (auto)
     * ─────────────────────────────────
     * row 1: name       | current-badge
     * row 2: dates+badge (span 2)
     */
    .event-picker-card {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 3px;
        padding: 11px 10px;
        border: none;
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
        background: transparent !important;
    }
    .event-picker-card:last-of-type {
        border-bottom: none;
    }
    .event-picker-card.current {
        background: var(--sakura-bg-hover) !important;
        border-radius: 10px;
    }
    .event-picker-card-name {
        grid-column: 1;
        grid-row: 1;
        padding-right: 0;
        font-size: 0.88em;
        min-width: 0;
        align-self: center;
    }
    .event-picker-current-badge {
        grid-column: 2;
        grid-row: 1;
        position: static;
        align-self: center;
        white-space: nowrap;
    }
    .event-picker-card-dates {
        grid-column: 1;
        grid-row: 2;
        display: block;
        font-size: 0.75em;
        align-self: center;
    }
    .event-picker-card-badge {
        grid-column: 2;
        grid-row: 2;
        margin-top: 0;
        align-self: center;
        white-space: nowrap;
    }
    /* card without current-badge: name spans row 1 fully */
    .event-picker-card:not(.current) .event-picker-card-name {
        grid-column: 1 / -1;
    }
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutBottom {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    body {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    header {
        padding: 50px 15px 20px;
        /* base seats the title below the 10–44px mobile button row */
        padding-top: calc(60px + env(safe-area-inset-top, 0px));
    }

    .language-switcher {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(10px + env(safe-area-inset-right, 0px));
        gap: 4px;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 0.75em;
        min-height: 32px;
        min-width: 40px;
    }

    h1 {
        font-size: 1.5em;
    }

    .header-nav {
        gap: 10px;
        margin-top: 15px;
    }

    .header-nav-link {
        font-size: 0.9em;
        padding: 10px 16px;
        min-height: 44px;
        flex: 1 1 auto;
        max-width: 48%;
        justify-content: center;
    }

    .content {
        padding: 20px 15px;
    }

    .section h2 {
        font-size: 1.3em;
    }

    .section h3 {
        font-size: 1.1em;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .contact-icon {
        font-size: 2.5em;
    }

    footer {
        padding: 15px;
    }

    .footer-text {
        font-size: 0.85em;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    h1 {
        font-size: 1.2em;
    }

    header p {
        font-size: 0.8em;
    }
}

/* ========================================
   Import ICS Styles
   ======================================== */

/* Upload Area */
.upload-area {
    margin: 20px 0;
}

.upload-box {
    border: 3px dashed var(--sakura-light);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--sakura-bg-hover);
}

.upload-box:hover {
    border-color: var(--sakura-medium);
    background: var(--sakura-bg-medium);
}

.upload-box.dragover {
    border-color: var(--sakura-dark);
    background: var(--sakura-bg-dark);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--sakura-medium);
}

.upload-placeholder p {
    margin: 8px 0;
    font-size: 1.1rem;
}

.upload-placeholder strong {
    color: var(--sakura-dark);
}

.upload-hint {
    color: #999;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Upload Progress */
#uploadProgress {
    text-align: center;
    padding: 20px;
}

.progress-bar {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 15px auto;
}

.progress-fill {
    height: 100%;
    background: var(--sakura-gradient);
    transition: width 0.3s ease;
    border-radius: 4px;
}

#progressText {
    color: var(--sakura-dark);
    font-weight: 500;
    margin-top: 10px;
}

/* Preview Section */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-header h3 {
    margin: 0;
    color: var(--sakura-dark);
}

.preview-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-new {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.stat-duplicate {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.stat-error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.preview-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.preview-table {
    margin: 20px 0;
}

.preview-table th {
    background: var(--sakura-gradient);
    color: white;
    font-weight: 600;
}

.preview-footer {
    text-align: center;
    margin: 25px 0;
    padding: 25px;
    background: var(--sakura-bg-hover);
    border-radius: 12px;
    border: 2px solid var(--sakura-light);
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-new {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.status-duplicate {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.status-invalid {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* Duplicate Action Dropdown */
.dup-action-select {
    padding: 6px 10px;
    border: 2px solid var(--sakura-light);
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.dup-action-select:hover {
    border-color: var(--sakura-medium);
}

.dup-action-select:focus {
    outline: none;
    border-color: var(--sakura-dark);
}

/* Summary Section */
.summary-box {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-width: 700px;
    margin: 30px auto;
    border: 2px solid var(--sakura-light);
}

.summary-box h3 {
    margin-top: 0;
    color: var(--sakura-dark);
    text-align: center;
    font-size: 1.8rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: var(--bg-light);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    border-color: var(--sakura-light);
}

.summary-icon {
    font-size: 2rem;
}

.summary-label {
    font-weight: 600;
    color: #555;
    flex: 1;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--sakura-dark);
}

.errors-box {
    background: var(--color-error-bg);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--color-error-text);
}

.errors-box h4 {
    margin-top: 0;
    color: var(--color-error-text);
}

.errors-box ul {
    margin: 10px 0 0;
    padding-left: 25px;
}

.errors-box li {
    color: #666;
    margin: 5px 0;
}

/* ===== Theme Switcher ===== */
.theme-switcher {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.theme-btn.active,
.theme-btn:hover {
    border-color: white;
    transform: scale(1.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
    .theme-switcher {
        top: auto;
        left: auto;
        position: static;
        justify-content: center;
        margin-top: 10px;
    }
}

/* Responsive Adjustments for Import */
@media (max-width: 768px) {
    .upload-box {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-stats,
    .preview-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .summary-box {
        padding: 20px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .summary-value {
        font-size: 1.5rem;
    }
}

/* ─── Monthly Calendar View ──────────────────────────────────────────────── */

#month-calendar-view {
    margin: 5px 5px 1.5rem 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.month-calendar {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--sakura-dark-20);
}

/* Header: month label + nav buttons */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--sakura-dark-15), var(--sakura-dark-10));
    border-bottom: 1px solid var(--sakura-dark-20);
}

.cal-month-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sakura-deeper, #880E4F);
    letter-spacing: 0.03em;
}

.cal-nav-btn {
    background: var(--sakura-dark-20);
    border: 1px solid var(--sakura-dark-40);
    color: var(--sakura-deeper, #880E4F);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background 0.15s;
}
.cal-nav-btn:hover {
    background: var(--sakura-dark-40);
}

/* 7-column grid */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(52px, 1fr));
    gap: 0;
    width: 100%;
}

/* Day-of-week header row */
.cal-dow {
    padding: 0.4rem 0;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.2);
    border-left: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cal-dow:first-child { border-left: none; }
.cal-dow-sun { color: #555; }
.cal-dow-sat { color: #555; }

/* Day cells */
.cal-day {
    min-height: 110px;
    padding: 0.3rem 0.3rem 0.4rem;
    border-left: 1px solid rgba(255,255,255,0.09);
    border-bottom: 1px solid rgba(255,255,255,0.09);
    vertical-align: top;
    box-sizing: border-box;
    background: rgba(255,255,255,0.02);
}
.cal-day:nth-child(7n+1) { border-left: none; }
.cal-day-empty {
    background: rgba(0,0,0,0.15);
    min-height: 110px;
}
.cal-day-today {
    background: var(--sakura-dark-10);
}
.cal-day-today .cal-day-num {
    background: var(--sakura-dark, #E91E63);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.cal-day-sun .cal-day-num { color: #c0392b; }
.cal-day-sat .cal-day-num { color: #1565c0; }

.cal-day-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sakura-deeper, #880E4F);
    margin-bottom: 0.2rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Program chips inside day cells */
.cal-chips {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-chip {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--sakura-dark-20);
    border-left: 3px solid var(--sakura-dark-50);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    overflow: hidden;
}
.cal-chip:hover {
    background: var(--sakura-dark-30);
}

/* All platforms share theme color — icon differentiates the platform */
.cal-has-stream {
    background: var(--sakura-dark-30);
    border-left-color: var(--sakura-dark);
}
.cal-has-stream:hover {
    background: var(--sakura-dark-40);
}

.cal-chip-icon {
    font-size: 0.65rem;
    flex-shrink: 0;
    line-height: 1;
}
.cal-chip-artist {
    font-size: 0.68rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.cal-chip-time {
    font-size: 0.6rem;
    color: #333;
    flex-shrink: 0;
    white-space: nowrap;
}
.cal-chip-has-local {
    flex-wrap: wrap;
}
.cal-chip-time-local {
    width: 100%;
    font-size: 0.55rem;
    color: #666;
    font-style: italic;
    white-space: nowrap;
    padding-left: 1px;
}

/* Calendar detail modal inner (displayed inside req-modal which has white bg) */
.cal-detail-modal-inner {
    padding: 0.25rem 0;
}
.cal-detail-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--sakura-deep, #C2185B);
    letter-spacing: 0.03em;
}
.cal-detail-duration {
    font-size: 0.85rem;
    font-weight: 400;
    color: #888;
    margin-left: 0.3em;
}
.cal-detail-time-local {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin: -0.2rem 0 0.5rem;
}
.cal-detail-row {
    font-size: 0.88rem;
    color: #444;
    margin-bottom: 0.35rem;
}
/* Clickable artist profile links inside calendar detail modal + day panel */
.cal-artist-link {
    color: var(--sakura-deep, #C2185B);
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.cal-artist-link:hover {
    border-bottom-style: solid;
}
.cal-detail-header-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}
.cal-detail-desc {
    font-size: 0.82rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.5;
    white-space: pre-line;
}
.cal-detail-join {
    display: inline-block;
    margin-top: 0.75rem;
    text-decoration: none;
    font-size: 0.85rem;
}

/* Dot indicators (hidden on desktop, shown on mobile) */
.cal-day-dots {
    display: none;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
    align-items: center;
}
.cal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sakura-dark, #E91E63);
    opacity: 0.7;
    flex-shrink: 0;
}
.cal-dot-stream {
    background: var(--sakura-deeper, #880E4F);
    opacity: 1;
}
.cal-dot-more {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sakura-deeper, #880E4F);
    line-height: 1;
}

/* Selected day highlight */
.cal-day-has-events { cursor: pointer; }
.cal-day-selected {
    background: var(--sakura-dark-20) !important;
    outline: 2px solid var(--sakura-dark, #E91E63);
    outline-offset: -2px;
}

/* Day panel */
#calDayPanel {
    display: none;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--sakura-dark-20);
    margin: 0.75rem 5px 1rem;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--sakura-dark-20);
}
#calDayPanel.active { display: block; }

.cal-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, var(--sakura-dark-15), var(--sakura-dark-10));
    border-bottom: 1px solid var(--sakura-dark-20);
}
.cal-dp-date {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sakura-deeper, #880E4F);
}
.cal-dp-body { padding: 0.25rem 0; }

.cal-dp-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    transition: background 0.12s;
}
.cal-dp-item:last-child { border-bottom: none; }
.cal-dp-item:active { background: var(--sakura-dark-10); }

.cal-dp-item-left {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    font-size: 1rem;
}
.cal-dp-icon { font-size: 1rem; }

.cal-dp-item-info { flex: 1; min-width: 0; }

.cal-dp-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-dp-item-artist {
    font-size: 0.78rem;
    color: var(--sakura-deep, #C2185B);
    margin-top: 2px;
}
.cal-dp-item-time {
    font-size: 0.78rem;
    color: #555;
    margin-top: 2px;
    white-space: nowrap;
}
.cal-dp-item-time-local {
    font-size: 0.72rem;
    color: #888;
    font-style: italic;
    white-space: nowrap;
    margin-top: 1px;
}
.cal-dp-item-type {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--sakura-deeper, #880E4F);
    background: var(--sakura-dark-10);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    margin-top: 3px;
}
.cal-dp-item-desc {
    font-size: 0.75rem;
    color: #666;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cal-dp-join-wrap {
    margin-top: 0.4rem;
}
.cal-dp-join {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    text-decoration: none;
}

/* ── Shared utility button (pages without index.css / artist.css) ─────────── */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
    background: #f0f0f0;
    color: #333;
}
.btn:hover { opacity: 0.85; }
.btn-primary {
    background: var(--sakura-gradient, linear-gradient(135deg,#FFB7C5 0%,#E91E63 100%));
    color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(233,30,99,0.3); }


/* Responsive: mobile dot view */
@media (max-width: 600px) {
    /* Make month-calendar the scroll container, not clipping the grid */
    .month-calendar {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    /* Fill available width, but enforce min 46px per col (322px total) for scroll on very narrow screens */
    .cal-grid {
        grid-template-columns: repeat(7, minmax(46px, 1fr));
    }
    .cal-day { min-height: 64px; padding: 0.25rem 0.2rem; }
    .cal-day-empty { min-height: 64px; }
    .cal-chips { display: none; }
    .cal-day-dots { display: flex; }
    .cal-month-label { font-size: 0.95rem; }
    /* #month-calendar-view still needed for outer containment */
    #month-calendar-view { overflow: visible; }
}

/* Google AdSense ad units */
.ads-unit {
    text-align: center;
    margin: 16px auto;
}
.ads-leaderboard {
    max-width: 728px;
}
@media (max-width: 767px) {
    .ads-leaderboard { display: none; }
}
.ads-rectangle {
    max-width: 336px;
}
.ads-responsive {
    width: 100%;
}
