:root {
    --bg-color: #0f172a; /* Slate 900 */
    --surface-color: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --surface-hover: rgba(30, 41, 59, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6; /* Blue 500 */
    --accent-glow: rgba(59, 130, 246, 0.5);
    --danger-color: #ef4444;
    --success-color: #10b981;
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated blobs */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.bg-shape-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
}

.bg-shape-2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: 100px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Layout */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo h2 {
    font-weight: 600;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
}

.badge {
    display: inline-block;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.icon-small {
    width: 16px;
    height: 16px;
}

/* Main Content */
.timeline-header {
    margin-bottom: 2rem;
}

.timeline-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Error */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: var(--glass-blur);
}

/* Timeline */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-card {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-card:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.event-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
    margin-right: 1.5rem;
}

.event-day {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.event-month {
    font-size: 0.875rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 0.25rem;
}

.event-main {
    flex: 1;
}

.event-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.event-duration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.event-duration svg {
    width: 14px;
    height: 14px;
}

.event-action {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.event-card:hover .event-action {
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Side Panel */
.side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 20;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.side-panel.active {
    right: 0;
}

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

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.panel-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.panel-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row svg {
    color: var(--accent-color);
}

.crm-data-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.crm-data-row:last-child {
    margin-bottom: 0;
}

.crm-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-value {
    font-size: 1rem;
    font-weight: 500;
}

.crm-empty {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.875rem;
    text-align: center;
}

@media (max-width: 600px) {
    .event-time {
        min-width: 60px;
        padding-right: 1rem;
        margin-right: 1rem;
    }
    
    .event-day {
        font-size: 1.5rem;
    }
    
    .event-title {
        font-size: 1rem;
    }
}
