/* SchengenSafe — Styles
   Theme: Passport-inspired dark mode with navy/gold palette
   Mobile-first responsive, desktop breakpoint at 960px
*/

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
    /* Core palette */
    --navy-deep: #0B1426;
    --navy: #111D35;
    --navy-mid: #162444;
    --navy-light: #1E3058;
    --navy-surface: #243A62;

    /* Accent */
    --gold: #D4A853;
    --gold-light: #E8C97A;
    --gold-dim: #9E7B3A;
    --gold-bg: rgba(212, 168, 83, 0.08);

    /* Status colors */
    --safe: #2ECC71;
    --safe-bg: rgba(46, 204, 113, 0.12);
    --caution: #F39C12;
    --caution-bg: rgba(243, 156, 18, 0.12);
    --warning: #E74C3C;
    --warning-bg: rgba(231, 76, 60, 0.12);
    --overstay: #C0392B;
    --overstay-bg: rgba(192, 57, 43, 0.18);

    /* Text */
    --text-primary: #F0F0F5;
    --text-secondary: #A0AAC0;
    --text-muted: #6B7A99;
    --text-inverse: #0B1426;

    /* Misc */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(22, 36, 68, 0.65);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    /* Typography */
    --font-ui: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.25s;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    background-color: var(--navy-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* Topographic/map pattern — pure CSS */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(212, 168, 83, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(46, 204, 113, 0.02) 0%, transparent 40%),
        repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255,255,255,0.008) 1deg, transparent 2deg);
}

/* Hidden attribute override — some display: flex rules break [hidden] */
[hidden] {
    display: none !important;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4 {
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

p {
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========== GLASS CARD ========== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--text-inverse);
    box-shadow: 0 2px 12px rgba(212, 168, 83, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--navy-mid);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--navy-light);
    border-color: var(--border-hover);
}

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

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: transparent;
    color: var(--warning);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    background: var(--warning-bg);
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--navy-mid);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.btn-icon-only:hover {
    background: var(--navy-light);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
}

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

/* ========== HEADER ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 20, 38, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--gold);
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    padding: 0.4rem 0.7rem;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* ========== MAIN LAYOUT ========== */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ========== AD PLACEHOLDERS ========== */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
    margin: 0 auto;
}

.ad-mobile {
    width: 320px;
    height: 50px;
    max-width: 100%;
}

.ad-desktop {
    display: none;
}

/* ========== STATUS SECTION ========== */
.status-section {
    scroll-margin-top: 80px;
}

.status-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--safe), var(--caution), var(--warning));
    opacity: 0.6;
}

.status-badge-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--safe-bg);
    color: var(--safe);
    border: 1px solid rgba(46, 204, 113, 0.25);
    transition: all 0.4s var(--ease);
}

.status-badge.caution {
    background: var(--caution-bg);
    color: var(--caution);
    border-color: rgba(243, 156, 18, 0.25);
}

.status-badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(231, 76, 60, 0.25);
    animation: pulse-warning 2s ease-in-out infinite;
}

.status-badge.overstay {
    background: var(--overstay-bg);
    color: var(--overstay);
    border-color: rgba(192, 57, 43, 0.4);
    animation: pulse-warning 1.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.15); }
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-metrics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.metric {
    text-align: center;
    flex: 0 0 auto;
}

.metric-hero .metric-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--gold);
}

.metric-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.metric-value.negative {
    color: var(--warning);
}

.metric-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}

.metric-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

.status-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.detail-icon {
    flex-shrink: 0;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    margin-left: auto;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.overstay-value {
    color: var(--warning) !important;
    font-weight: 700 !important;
}

.status-progress {
    margin-top: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--safe), var(--caution));
    transition: width 0.8s var(--ease), background 0.5s var(--ease);
    min-width: 0;
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--caution), var(--warning));
}

.progress-fill.overstay-bar {
    background: linear-gradient(90deg, var(--warning), var(--overstay));
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-family: var(--font-mono);
}

/* ========== WARNING BANNER ========== */
.warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--warning-bg);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-sm);
    animation: slideDown 0.4s var(--ease);
}

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

.warning-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.warning-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.warning-text strong {
    color: var(--warning);
}

/* ========== TRIP SECTION ========== */
.trip-section {
    scroll-margin-top: 80px;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.01);
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.empty-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 340px;
}

/* Trip form */
.trip-form {
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: slideDown 0.3s var(--ease);
}

.form-title {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.input-date, .input-text {
    padding: 0.6rem 0.75rem;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: border-color var(--duration) var(--ease);
    width: 100%;
}

.input-date:focus, .input-text:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

/* Date input color scheme for dark mode */
.input-date::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

.form-validation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--caution-bg);
    border-radius: var(--radius-xs);
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--caution);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Trip list */
.trip-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    animation: fadeInUp 0.3s var(--ease);
    cursor: pointer;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.trip-item:hover {
    border-color: var(--border-hover);
    background: rgba(22, 36, 68, 0.8);
}

.trip-item.is-future {
    border-style: dashed;
    opacity: 0.75;
}

.trip-item.is-future:hover {
    opacity: 1;
}

.trip-item.has-overlap {
    border-color: rgba(243, 156, 18, 0.4);
}

.trip-color-bar {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    background: var(--safe);
    flex-shrink: 0;
}

.trip-item.is-future .trip-color-bar {
    background: var(--text-muted);
}

.trip-item.has-overlap .trip-color-bar {
    background: var(--caution);
}

.trip-dates {
    flex: 1;
    min-width: 0;
}

.trip-date-range {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.trip-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.trip-day-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.trip-note {
    font-size: 0.7rem;
    color: var(--gold-dim);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.trip-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(107, 122, 153, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(107, 122, 153, 0.2);
}

.trip-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.trip-btn {
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--duration) var(--ease);
}

.trip-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.trip-btn.delete:hover {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ========== CALENDAR SECTION ========== */
.calendar-section {
    scroll-margin-top: 80px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cal-range {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
    text-align: center;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-outside { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.legend-safe { background: var(--safe); }
.legend-caution { background: var(--caution); }
.legend-warning { background: var(--warning); }
.legend-overstay { background: var(--overstay); }
.legend-planned { background: transparent; border: 2px dashed var(--text-muted); }
.legend-today { background: transparent; border: 2px solid var(--gold); }

.calendar-grid-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cal-month {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
}

.cal-month-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.cal-weekday {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.25rem 0;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    cursor: default;
    transition: all 0.15s var(--ease);
}

.cal-day.empty {
    background: transparent;
    cursor: default;
}

.cal-day.in-schengen {
    background: rgba(46, 204, 113, 0.2);
    color: var(--safe);
    font-weight: 600;
}

.cal-day.status-caution {
    background: rgba(243, 156, 18, 0.2);
    color: var(--caution);
}

.cal-day.status-warning {
    background: rgba(231, 76, 60, 0.2);
    color: var(--warning);
}

.cal-day.status-overstay {
    background: rgba(192, 57, 43, 0.25);
    color: var(--overstay);
    font-weight: 700;
}

.cal-day.is-planned {
    background: transparent;
    border: 1.5px dashed var(--text-muted);
    color: var(--text-secondary);
}

.cal-day.is-today {
    outline: 2px solid var(--gold);
    outline-offset: -1px;
    font-weight: 700;
    color: var(--gold);
    z-index: 1;
}

.cal-day.outside-window {
    opacity: 0.35;
}

.cal-day:not(.empty):hover {
    transform: scale(1.2);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Calendar tooltip */
.cal-tooltip {
    position: fixed;
    z-index: 200;
    padding: 0.5rem 0.75rem;
    background: var(--navy);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow);
    pointer-events: none;
    font-size: 0.75rem;
    max-width: 200px;
}

.tooltip-date {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.tooltip-detail {
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========== PLANNER SECTION ========== */
.planner-section {
    scroll-margin-top: 80px;
}

.planner-card {
    padding: 1.5rem;
}

.planner-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.planner-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.planner-input-row .form-group {
    flex: 1;
    min-width: 180px;
}

.planner-result {
    margin-top: 1rem;
    padding: 1.25rem;
    background: var(--gold-bg);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: var(--radius-sm);
    text-align: center;
    animation: slideDown 0.3s var(--ease);
}

.planner-result-value {
    margin-bottom: 0.5rem;
}

.planner-result-value .metric-value {
    color: var(--gold);
    font-size: 2.5rem;
}

.planner-result-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========== EXPORT SECTION ========== */
.export-section {
    scroll-margin-top: 80px;
}

.export-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========== HOW IT WORKS ========== */
.how-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.how-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.how-card {
    padding: 1.25rem;
    position: relative;
}

.how-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--text-inverse);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.how-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.how-card p {
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ========== FOOTER ========== */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-privacy {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--safe-bg);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(46, 204, 113, 0.15);
}

.privacy-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.footer-privacy p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer-disclaimer {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
}

.footer-disclaimer p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-brand p {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s var(--ease);
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.3s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
}

.modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.country-chip {
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 70px;
    right: 1rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 0.8rem;
    color: var(--text-primary);
    pointer-events: auto;
    animation: toastIn 0.3s var(--ease);
    max-width: 320px;
}

.toast.toast-out {
    animation: toastOut 0.25s var(--ease) forwards;
}

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

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

.toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ========== PRINT STYLES ========== */
@media print {
    body {
        background: white !important;
        color: #222 !important;
    }

    .site-header,
    .header-nav,
    .ad-placeholder,
    .btn-add-trip,
    .btn,
    .trip-form,
    .empty-state,
    .cal-tooltip,
    .toast-container,
    .warning-banner,
    .export-section,
    .planner-section,
    #btn-add-trip,
    #btn-add-trip-empty,
    .trip-actions,
    .calendar-nav,
    .calendar-legend,
    .how-section,
    .site-footer {
        display: none !important;
    }

    .glass-card, .cal-month {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .status-card::before {
        display: none;
    }

    .metric-value, .status-badge, .detail-value, .trip-date-range {
        color: #222 !important;
        -webkit-text-fill-color: #222 !important;
    }

    .metric-label, .detail-label, .trip-day-count, .trip-note {
        color: #666 !important;
    }

    .status-badge {
        border: 1px solid #999 !important;
        animation: none !important;
    }

    .cal-day {
        border: 1px solid #eee;
        color: #444 !important;
    }

    .cal-day.in-schengen {
        background: #d4edda !important;
        color: #222 !important;
    }

    .cal-day.status-warning, .cal-day.status-overstay {
        background: #f8d7da !important;
        color: #222 !important;
    }

    main {
        max-width: 100%;
        padding: 0;
    }

    .print-header {
        display: block !important;
        text-align: center;
        padding: 1rem 0;
        border-bottom: 2px solid #222;
        margin-bottom: 1rem;
    }
}

.print-header {
    display: none;
}

/* ========== RESPONSIVE: TABLET ========== */
@media (min-width: 600px) {
    .form-row {
        flex-direction: row;
    }

    .form-group {
        flex: 1;
    }

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

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

    .status-metrics {
        gap: 2rem;
    }
}

/* ========== RESPONSIVE: DESKTOP ========== */
@media (min-width: 960px) {
    h2 {
        font-size: 1.75rem;
    }

    main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    /* Ad mobile hidden on desktop */
    .ad-mobile {
        display: none;
    }

    /* Ad desktop shown */
    .ad-desktop {
        display: flex;
        width: 728px;
        height: 90px;
        grid-column: 1 / -1;
    }

    /* Layout grid areas */
    .status-section {
        grid-column: 1 / -1;
    }

    .trip-section {
        grid-column: 1;
        grid-row: span 2;
    }

    .calendar-section {
        grid-column: 2;
    }

    .planner-section {
        grid-column: 2;
    }

    .export-section {
        grid-column: 1 / -1;
    }

    /* Sticky status */
    .status-card {
        position: sticky;
        top: 65px;
        z-index: 10;
    }

    .how-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .metric-hero .metric-value {
        font-size: 4rem;
    }

    .country-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .calendar-grid-wrapper {
        flex-direction: column;
    }
}

/* ========== RESPONSIVE: WIDE ========== */
@media (min-width: 1200px) {
    .header-inner,
    main,
    .how-section,
    .footer-inner {
        max-width: 1400px;
    }
}

/* ========== ANIMATIONS: Staggered calendar fade-in ========== */
.cal-day {
    opacity: 0;
    animation: cellFadeIn 0.2s var(--ease) forwards;
}

.cal-day.empty {
    animation: none;
    opacity: 1;
}

@keyframes cellFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Counter animation class */
.counter-animate {
    transition: transform 0.3s var(--ease);
}
