:root {
    --color-rose: #e91e63;
    --color-soft-pink: #f8bbd9;
    --color-burgundy: #880e4f;
    --color-lavender: #ce93d8;
    --color-cream: #fff8e7;
    --color-warm-brown: #5d4037;
    --color-charcoal: #424242;
    --color-sage: #a5d6a7;
    --color-soft-blue: #90caf9;
    --color-gold: #ffd54f;
    --bg-paper: #fffef9;
    --bg-toolbar: #fafafa;
    --shadow-soft: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --font-display: 'Playfair Display', serif;
    --font-handwritten: 'Patrick Hand', cursive;
    --font-typewriter: 'Special Elite', monospace;
    --font-ui: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-ui);
    background: var(--bg-paper);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-toolbar);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px var(--shadow-soft);
    z-index: 100;
}

.header-left .app-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-burgundy);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.partner-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-charcoal);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.status-indicator.offline {
    background: #9e9e9e;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.timeline-sidebar {
    width: 240px;
    background: var(--bg-toolbar);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.timeline-header h3 {
    font-weight: 600;
    color: var(--color-charcoal);
}

.timeline-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.timeline-controls {
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 8px;
}

.btn-secondary {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.02);
}

.canvas-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.canvas-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
}

#main-canvas {
    display: block;
    cursor: crosshair;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.app-toolbar {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-toolbar);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 8px var(--shadow-soft);
    gap: 32px;
    overflow-x: auto;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-group label {
    font-size: 0.85rem;
    color: var(--color-charcoal);
    font-weight: 500;
    white-space: nowrap;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

.tool-btn.active {
    background: var(--color-rose);
    color: white;
    border-color: var(--color-rose);
}

.color-palette {
    display: flex;
    align-items: center;
    gap: 4px;
}

.color-btn {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: var(--color-charcoal);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-charcoal);
}

#custom-color {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    cursor: pointer;
    padding: 2px;
}

#brush-size {
    width: 100px;
}

#size-display {
    font-size: 0.85rem;
    color: var(--color-charcoal);
    min-width: 30px;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .timeline-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 90;
        transform: translateX(-100%);
    }
    
    .timeline-sidebar.visible {
        transform: translateX(0);
    }
    
    .app-toolbar {
        gap: 16px;
        padding: 8px 16px;
    }
    
    .toolbar-section {
        gap: 12px;
    }
    
    .tool-group {
        gap: 4px;
    }
}