/* Modern AI Platform Theme */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #0f0f12;
    --bg-card: #18181b;
    --bg-elevated: #1f1f23;

    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.15);

    --color-official: #c084fc;
    --color-official-bg: rgba(192, 132, 252, 0.15);
    --color-bridge: #2dd4bf;
    --color-bridge-bg: rgba(45, 212, 191, 0.12);
    --color-weekend: #3f3f46;
    --color-weekend-text: #71717a;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --border-color: #27272a;
    --border-subtle: #1f1f23;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
}

.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.header__logo-img {
    width: 32px;
    height: auto;
}

.header__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.year-select {
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2371717a' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all 0.15s ease;
}

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

.year-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Main */
.main {
    padding: 24px 0 48px;
}

.holidays__header {
    margin-bottom: 20px;
}

.holidays__title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.holidays__subtitle {
    color: var(--text-muted);
    font-size: 13px;
}

/* Feed */
.feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s ease;
}

.card:hover {
    border-color: var(--border-color);
}

.card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card__info {
    flex: 1;
    min-width: 0;
}

.card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.card__date {
    font-size: 12px;
    color: var(--text-muted);
}

.card__badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card__badge--religious {
    background: var(--color-official-bg);
    color: var(--color-official);
}

.card__badge--official {
    background: var(--accent-glow);
    color: var(--accent-secondary);
}

/* Stats */
.card__stats {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat__value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stat__value--total {
    color: var(--text-primary);
}

.stat__value--bridge {
    color: var(--color-bridge);
}

.stat__label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Days */
.card__days {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 2px;
    margin: -2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.card__days::-webkit-scrollbar {
    display: none;
}

.day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.day__num {
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.day__name {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 3px;
}

/* Day Types */
.day--official {
    background: var(--color-official);
    color: white;
}

.day--official .day__name {
    color: rgba(255, 255, 255, 0.7);
}

.day--official-half {
    background: var(--bg-elevated);
    color: var(--color-official);
    border: 1.5px solid var(--color-official);
}

.day--official-half::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--color-official);
    opacity: 0.25;
}

.day--official-half .day__name {
    color: var(--color-official);
    opacity: 0.7;
}

.day--bridge {
    background: var(--color-bridge-bg);
    color: var(--color-bridge);
    border: 1.5px solid var(--color-bridge);
}

.day--bridge .day__name {
    color: var(--color-bridge);
    opacity: 0.7;
}

.day--bridge-half {
    background: var(--bg-elevated);
    color: var(--color-bridge);
    border: 1.5px solid var(--color-bridge);
}

.day--bridge-half::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--color-bridge);
    opacity: 0.15;
}

.day--bridge-half .day__name {
    color: var(--color-bridge);
    opacity: 0.7;
}

.day--weekend {
    background: var(--color-weekend);
    color: var(--color-weekend-text);
}

.day--weekend .day__name {
    color: var(--text-muted);
}

/* Legend */
.card__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-dot--official {
    background: var(--color-official);
}

.legend-dot--official-half {
    background: linear-gradient(to top, var(--color-official) 50%, var(--bg-elevated) 50%);
    border: 1px solid var(--color-official);
}

.legend-dot--bridge {
    background: var(--color-bridge-bg);
    border: 1px solid var(--color-bridge);
}

.legend-dot--weekend {
    background: var(--color-weekend);
}

/* Hints */
.card__hints {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Empty State */
.empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

/* Error */
.error-message {
    text-align: center;
    padding: 48px 16px;
}

.error-message p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn--primary {
    background: var(--accent-primary);
    color: white;
}

.btn--primary:hover {
    background: var(--accent-secondary);
}

/* Footer */
.footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-subtle);
}

.footer__text {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

.footer__author {
    text-align: center;
    font-size: 11px;
    margin-top: 4px;
}

.footer__author a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer__author a:hover {
    color: var(--accent-primary);
}

/* Header Actions */
.header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Help Button */
.help-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.help-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal.is-open .modal__content {
    transform: scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal__close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal__close:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.modal__body {
    padding: 16px;
}

.modal__body p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal__example {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 16px;
}

.modal__example h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.modal__example p {
    margin-bottom: 0;
    font-size: 12px;
}

.modal__legend {
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

.modal__legend h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.modal__legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

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

/* Utils */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .card {
        padding: 14px;
    }

    .day {
        min-width: 36px;
        height: 48px;
    }

    .day__num {
        font-size: 13px;
    }
}
