/* TravelTime Editor Styles */

/* ============================================
   Background Textures
   ============================================ */
.bg-paper {
    background-color: #fdfbf7;
    background-image: radial-gradient(#e5e0d8 1px, transparent 1px);
    background-size: 24px 24px;
}

.bg-kraft {
    background-color: #d4a574;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 90, 43, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 90, 43, 0.2) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.15'/%3E%3C/svg%3E");
}

.bg-grid {
    background-color: #fdfbf7;
    background-image: 
        linear-gradient(to right, #c8d4e3 1px, transparent 1px),
        linear-gradient(to bottom, #c8d4e3 1px, transparent 1px);
    background-size: 24px 24px;
}

.bg-white-paper {
    background-color: #ffffff;
    background-image: none;
}

/* ============================================
   Timeline Styles
   ============================================ */
.timeline-container {
    position: relative;
    padding: 2rem 1rem;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
}

.timeline-node {
    position: relative;
    margin-bottom: 3rem;
    animation: fadeInUp 0.5s ease forwards;
}

.timeline-node:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 1.5rem;
    width: 20px;
    height: 20px;
    transform: translateX(-50%);
    background: #ff4d4d;
    border: 3px solid #2d2d2d;
    border-radius: 50%;
    z-index: 10;
}

.timeline-content {
    width: calc(50% - 2rem);
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #2d2d2d;
    box-shadow: 4px 4px 0px 0px #2d2d2d;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-content:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px #2d2d2d;
}

.timeline-node:nth-child(odd) .timeline-content {
    margin-left: auto;
    margin-right: calc(50% + 2rem);
}

.timeline-node:nth-child(even) .timeline-content {
    margin-left: calc(50% + 2rem);
}

/* Mobile: Single column layout */
@media (max-width: 768px) {
    .timeline-line {
        left: 1rem;
    }
    
    .timeline-dot {
        left: 1rem;
    }
    
    .timeline-content,
    .timeline-node:nth-child(odd) .timeline-content,
    .timeline-node:nth-child(even) .timeline-content {
        width: calc(100% - 3rem);
        margin-left: 3rem;
        margin-right: 0;
    }
}

/* ============================================
   Hand-drawn SVG Line Styles
   ============================================ */
.hand-drawn-line {
    stroke: #2d2d2d;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hand-drawn-line-dashed {
    stroke-dasharray: 8, 6;
}

/* ============================================
   Form Styles
   ============================================ */
.wobbly-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #2d2d2d;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    background: white;
    font-family: "LXGW WenKai Screen", "Patrick Hand", cursive;
    font-size: 1rem;
    color: #2d2d2d;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wobbly-input:focus {
    border-color: #2d5da1;
    box-shadow: 0 0 0 3px rgba(45, 93, 161, 0.2);
}

.wobbly-input::placeholder {
    color: rgba(45, 45, 45, 0.4);
}

.wobbly-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   Panel Styles
   ============================================ */
.control-panel {
    background: white;
    border: 3px solid #2d2d2d;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    box-shadow: 6px 6px 0px 0px #2d2d2d;
    padding: 1.5rem;
}

.panel-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px dashed #e5e0d8;
}

.panel-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ============================================
   Node Card Styles
   ============================================ */
.node-card {
    background: white;
    border: 2px solid #2d2d2d;
    border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 3px 3px 0px 0px rgba(45, 45, 45, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.node-card:hover {
    transform: rotate(-1deg);
}

.node-card.editing {
    border-color: #2d5da1;
    box-shadow: 4px 4px 0px 0px #2d5da1;
}

.node-card-date {
    font-weight: bold;
    color: #ff4d4d;
    font-size: 0.875rem;
}

.node-card-location {
    font-size: 1.125rem;
    font-weight: bold;
    margin: 0.25rem 0;
}

.node-card-description {
    color: #666;
    font-size: 0.9rem;
}

/* ============================================
   Style Switcher
   ============================================ */
.style-option {
    width: 48px;
    height: 48px;
    border: 2px solid #2d2d2d;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.style-option:hover {
    transform: scale(1.1);
}

.style-option.active {
    box-shadow: 0 0 0 3px #ff4d4d;
}

.style-paper { background-color: #fdfbf7; }
.style-kraft { background-color: #d4a574; }
.style-grid { 
    background-color: #fdfbf7;
    background-image: linear-gradient(to right, #c8d4e3 1px, transparent 1px),
                      linear-gradient(to bottom, #c8d4e3 1px, transparent 1px);
    background-size: 8px 8px;
}
.style-white { background-color: #ffffff; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   Mobile Drawer
   ============================================ */
.mobile-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid #2d2d2d;
    border-radius: 24px 24px 0 0;
    padding: 1rem;
    transform: translateY(calc(100% - 100px));
    transition: transform 0.3s ease;
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    width: 48px;
    height: 4px;
    background: #e5e0d8;
    border-radius: 2px;
    margin: 0 auto 1rem;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ============================================
   Export Preview
   ============================================ */
#export-canvas {
    position: fixed;
    left: -9999px;
    top: 0;
}
