/* Timeline Module CSS */

:root {
    --timeline-accent-1: #d30e17;
    --timeline-accent-2: #1778f2;
    --timeline-line: #b9c3ce;
    --timeline-surface: #f4f6f8;
    --timeline-text: #1e2430;
}

.timeline-scene {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 24px 20px 10px;
    background:
        radial-gradient(circle at 10% -5%, color-mix(in srgb, var(--timeline-accent-1) 14%, transparent), transparent 44%),
        radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--timeline-accent-2) 16%, transparent), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--timeline-surface) 96%, #ffffff) 0%, #ffffff 100%);
}

.timeline-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(22px);
    pointer-events: none;
    z-index: 0;
}

.timeline-glow--a {
    top: 28px;
    left: -40px;
    width: 180px;
    height: 180px;
    background: color-mix(in srgb, var(--timeline-accent-1) 40%, transparent);
    opacity: 0.35;
}

.timeline-glow--b {
    top: 20px;
    right: -30px;
    width: 170px;
    height: 170px;
    background: color-mix(in srgb, var(--timeline-accent-2) 42%, transparent);
    opacity: 0.35;
}

.timeline-header,
.timeline-container {
    position: relative;
    z-index: 1;
}

.timeline-header {
    max-width: 1000px;
    margin: 0 auto 26px;
    text-align: center;
}

.timeline-kicker {
    margin: 0;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--timeline-text) 62%, #ffffff);
    font-weight: 700;
}

.timeline-hero {
    margin: 8px 0 0;
    font-size: clamp(1.4rem, 2.7vw, 2.25rem);
    color: var(--timeline-text);
    line-height: 1.15;
}

.timeline-container {
    position: relative;
    max-width: 1050px;
    margin: 0 auto;
    padding: 20px 20px 10px;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--timeline-accent-1) 70%, var(--timeline-line)),
        var(--timeline-line),
        color-mix(in srgb, var(--timeline-accent-2) 70%, var(--timeline-line))
    );
    transform: translateX(-50%);
    border-radius: 999px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--timeline-line) 55%, transparent);
}

.timeline-entry {
    position: relative;
    margin-bottom: 34px;
    display: flex;
    gap: 28px;
    animation: timeline-rise 0.55s ease both;
}

.timeline-entry:nth-child(2n) {
    animation-delay: 0.08s;
}

.timeline-entry:nth-child(3n) {
    animation-delay: 0.14s;
}

.timeline-entry--right {
    flex-direction: row;
}

.timeline-entry--left {
    flex-direction: row-reverse;
}

.timeline-marker {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50%;
    position: relative;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--timeline-accent-1), var(--timeline-accent-2));
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--timeline-accent-2) 70%, transparent), 0 0 20px color-mix(in srgb, var(--timeline-accent-2) 28%, transparent);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-content {
    flex: 1;
    background: color-mix(in srgb, var(--timeline-surface) 92%, #ffffff);
    color: var(--timeline-text);
    padding: 20px;
    border-radius: 14px;
    border-left: 5px solid var(--timeline-accent-2);
    box-shadow: 0 10px 30px rgba(10, 22, 45, 0.08);
    backdrop-filter: blur(1.5px);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-content:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 34px rgba(10, 22, 45, 0.14);
}

.timeline-entry--left .timeline-content {
    border-left: none;
    border-right: 5px solid var(--timeline-accent-1);
}

.timeline-year {
    font-size: 1.48rem;
    font-weight: 800;
    color: var(--timeline-accent-2);
    margin-bottom: 8px;
    line-height: 1;
}

.timeline-month {
    font-size: 0.85rem;
    margin-left: 10px;
    color: color-mix(in srgb, var(--timeline-text) 60%, #ffffff);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.timeline-title {
    font-size: 1.25rem;
    margin: 0 0 8px;
    color: var(--timeline-text);
}

.timeline-description {
    font-size: 0.96rem;
    line-height: 1.68;
    color: color-mix(in srgb, var(--timeline-text) 82%, #ffffff);
}

.timeline-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--timeline-text) 72%, #ffffff);
    margin-bottom: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--timeline-accent-1) 12%, #ffffff);
}

.timeline-location::before {
    content: "●";
    color: var(--timeline-accent-1);
    font-size: 0.7rem;
}

.timeline-image-wrap {
    margin-bottom: 14px;
}

.timeline-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--timeline-line) 80%, #ffffff);
}

.timeline-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.timeline-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #cfd6df;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    flex: 0 0 auto;
}

.timeline-color-row input[type="text"] {
    max-width: 180px;
}

.timeline-color-picker {
    width: 42px;
    height: 32px;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    padding: 0;
    background: #fff;
    cursor: pointer;
    appearance: auto !important;
    -webkit-appearance: auto !important;
}

.timeline-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.timeline-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.timeline-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.timeline-settings-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 420px);
    gap: 24px;
    align-items: start;
}

.timeline-preview-col {
    border: 1px solid #dde3ea;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.timeline-preview-title {
    margin: 0 0 12px;
    font-size: 1rem;
}

.timeline-preview-scene {
    --timeline-accent-1: #d30e17;
    --timeline-accent-2: #1778f2;
    --timeline-line: #b9c3ce;
    --timeline-surface: #f4f6f8;
    --timeline-text: #1e2430;

    position: relative;
    min-height: 240px;
    padding: 12px 0 12px 34px;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.timeline-preview-line {
    position: absolute;
    left: 14px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--timeline-accent-1) 70%, var(--timeline-line)),
        var(--timeline-line),
        color-mix(in srgb, var(--timeline-accent-2) 70%, var(--timeline-line))
    );
}

.timeline-preview-dot {
    position: absolute;
    left: 6px;
    top: 42px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: linear-gradient(135deg, var(--timeline-accent-1), var(--timeline-accent-2));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--timeline-accent-2) 70%, transparent);
}

.timeline-preview-card {
    margin-top: 22px;
    background: color-mix(in srgb, var(--timeline-surface) 92%, #fff);
    color: var(--timeline-text);
    border-left: 5px solid var(--timeline-accent-2);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(10, 22, 45, 0.1);
}

.timeline-preview-year {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--timeline-accent-2);
}

.timeline-preview-year span {
    font-size: 0.72rem;
    margin-left: 6px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timeline-preview-card h4 {
    margin: 8px 0 6px;
    font-size: 1.05rem;
}

.timeline-preview-location {
    margin: 0 0 8px;
    font-size: 0.86rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--timeline-text) 75%, #fff);
}

.timeline-preview-card p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.timeline-preview-hint {
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.timeline-settings-actions {
    margin-top: 14px;
}

.timeline-empty {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes timeline-rise {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .timeline-scene {
        border-radius: 14px;
        padding: 18px 10px 4px;
    }

    .timeline-line {
        left: 28px;
    }

    .timeline-entry,
    .timeline-entry--left,
    .timeline-entry--right {
        flex-direction: row !important;
    }

    .timeline-marker {
        width: 50px;
        min-width: 50px;
    }

    .timeline-dot {
        left: 28px;
    }

    .timeline-content,
    .timeline-entry--left .timeline-content {
        flex: 1;
        border-right: none;
        border-left: 4px solid var(--timeline-accent-2);
    }
}

@media (max-width: 560px) {
    .timeline-container {
        padding: 14px 8px 8px;
    }

    .timeline-settings-grid {
        grid-template-columns: 1fr;
    }

    .timeline-content {
        padding: 14px;
    }

    .timeline-year {
        font-size: 1.25rem;
    }

    .timeline-title {
        font-size: 1.08rem;
    }

    .timeline-description {
        font-size: 0.9rem;
    }
}
