/* telomere.dev - Cottagecore Developer Dashboard */
/* Colors: #1a1a2e, #4a90d9, #f5f0e8, #e8b84b, #6c757d */
/* Fonts: Inter, Lora */

:root {
    --deep-base: #1a1a2e;
    --primary-blue: #4a90d9;
    --warm-offwhite: #f5f0e8;
    --accent-gold: #e8b84b;
    --muted-gray: #6c757d;
    --sage-green: #a8c5a0;
    --pale-lavender: #c4b5d4;
    --gentle-peach: #f0c9a6;
    --warm-cream: #faf6ef;
    --font-primary: 'Inter', sans-serif;
    --font-serif: 'Lora', serif;
    --elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font-primary);
    background: var(--warm-cream);
    color: var(--deep-base);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Watercolor Background */
.watercolor-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(74, 144, 217, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 30%, rgba(232, 184, 75, 0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(168, 197, 160, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 70%, rgba(196, 181, 212, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(240, 201, 166, 0.04) 0%, transparent 45%);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--deep-base);
    color: var(--warm-offwhite);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(245, 240, 232, 0.1);
}

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

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--warm-offwhite);
}

.logo-dot {
    color: var(--accent-gold);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(245, 240, 232, 0.6);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s var(--spring);
}

.nav-item:hover {
    color: var(--warm-offwhite);
    background: rgba(245, 240, 232, 0.08);
    transform: translateX(4px);
}

.nav-item.active {
    color: var(--warm-offwhite);
    background: rgba(74, 144, 217, 0.2);
}

.nav-item.active .nav-icon {
    color: var(--primary-blue);
}

.nav-icon {
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(245, 240, 232, 0.1);
}

.bio-strand {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    justify-content: center;
}

.strand-segment {
    width: 8px;
    height: 24px;
    border-radius: 4px;
    animation: strandPulse 2s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.3s);
}

.strand-segment:nth-child(1) { background: var(--primary-blue); }
.strand-segment:nth-child(2) { background: var(--accent-gold); }
.strand-segment:nth-child(3) { background: var(--sage-green); }
.strand-segment:nth-child(4) { background: var(--pale-lavender); }
.strand-segment:nth-child(5) { background: var(--gentle-peach); }

@keyframes strandPulse {
    0%, 100% { transform: scaleY(1); opacity: 0.6; }
    50% { transform: scaleY(1.5); opacity: 1; }
}

.sidebar-caption {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.4);
    line-height: 1.5;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    position: relative;
    z-index: 1;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.greeting {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--deep-base);
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--muted-gray);
    font-weight: 400;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary-blue);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-blue);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.date-display {
    font-size: 0.8rem;
    color: var(--muted-gray);
    font-weight: 400;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 24px;
    overflow: hidden;
    transition: transform 0.4s var(--elastic), box-shadow 0.4s ease;
    cursor: pointer;
    border: 1px solid rgba(26, 26, 46, 0.06);
}

.metric-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(26, 26, 46, 0.1);
}

.metric-card:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.15s ease;
}

.card-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.5;
}

.card-bloom .card-watercolor {
    background: radial-gradient(ellipse at 80% 20%, rgba(74, 144, 217, 0.08) 0%, transparent 60%);
}

.card-sage .card-watercolor {
    background: radial-gradient(ellipse at 80% 20%, rgba(168, 197, 160, 0.12) 0%, transparent 60%);
}

.card-lavender .card-watercolor {
    background: radial-gradient(ellipse at 80% 20%, rgba(196, 181, 212, 0.12) 0%, transparent 60%);
}

.card-peach .card-watercolor {
    background: radial-gradient(ellipse at 80% 20%, rgba(240, 201, 166, 0.12) 0%, transparent 60%);
}

.floral-border {
    position: absolute;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.floral-tl {
    top: 0;
    left: 0;
}

.floral-br {
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
}

.metric-card:hover .floral-border {
    opacity: 1;
}

.metric-icon {
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--deep-base);
    line-height: 1;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.metric-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted-gray);
}

.metric-label {
    font-size: 0.8rem;
    color: var(--muted-gray);
    font-weight: 500;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.metric-trend.up {
    color: #5a9e6f;
}

.metric-trend.neutral {
    color: var(--muted-gray);
}

.metric-trend.down {
    color: #c0564f;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 20px;
}

.panel {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 24px;
    overflow: hidden;
    transition: transform 0.4s var(--elastic), box-shadow 0.4s ease;
    border: 1px solid rgba(26, 26, 46, 0.06);
}

.panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.08);
}

.panel-wide {
    grid-column: span 2;
}

.panel-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.panel-wide .panel-watercolor {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.03) 0%, rgba(232, 184, 75, 0.03) 100%);
}

.panel-telomere .panel-watercolor {
    background: radial-gradient(ellipse at 50% 50%, rgba(74, 144, 217, 0.05) 0%, transparent 70%);
}

.panel-builds .panel-watercolor {
    background: linear-gradient(180deg, rgba(168, 197, 160, 0.04) 0%, transparent 100%);
}

.panel-garden .panel-watercolor {
    background: radial-gradient(ellipse at 30% 70%, rgba(168, 197, 160, 0.06) 0%, transparent 60%);
}

.panel-deps .panel-watercolor {
    background: linear-gradient(135deg, rgba(196, 181, 212, 0.04) 0%, transparent 100%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.panel-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deep-base);
}

.panel-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary-blue);
}

.panel-badge.bloom {
    background: rgba(168, 197, 160, 0.2);
    color: #5a9e6f;
}

.panel-count {
    font-size: 0.8rem;
    color: var(--muted-gray);
    font-weight: 500;
}

.panel-tabs {
    display: flex;
    gap: 4px;
    background: rgba(26, 26, 46, 0.04);
    border-radius: 10px;
    padding: 3px;
}

.tab-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-gray);
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.3s var(--spring);
}

.tab-btn:hover {
    color: var(--deep-base);
}

.tab-btn.active {
    background: white;
    color: var(--deep-base);
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.08);
}

/* Chart */
.chart-container {
    position: relative;
    z-index: 1;
    padding-top: 10px;
}

.chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 180px;
    gap: 12px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 8px;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 48px;
    height: var(--height);
    border-radius: 8px 8px 4px 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s var(--elastic);
}

.chart-bar:hover {
    transform: scaleY(1.05);
}

.bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-blue) 0%, rgba(74, 144, 217, 0.4) 100%);
    border-radius: 8px 8px 4px 4px;
    animation: barGrow 0.8s var(--spring) backwards;
}

.chart-bar-group:nth-child(1) .bar-fill { animation-delay: 0.1s; }
.chart-bar-group:nth-child(2) .bar-fill { animation-delay: 0.15s; }
.chart-bar-group:nth-child(3) .bar-fill { animation-delay: 0.2s; }
.chart-bar-group:nth-child(4) .bar-fill { animation-delay: 0.25s; }
.chart-bar-group:nth-child(5) .bar-fill { animation-delay: 0.3s; }
.chart-bar-group:nth-child(6) .bar-fill { animation-delay: 0.35s; }
.chart-bar-group:nth-child(7) .bar-fill { animation-delay: 0.4s; }

@keyframes barGrow {
    from { transform: scaleY(0); transform-origin: bottom; }
    to { transform: scaleY(1); transform-origin: bottom; }
}

.chart-label {
    font-size: 0.7rem;
    color: var(--muted-gray);
    font-weight: 500;
}

/* Telomere Visual */
.telomere-visual {
    position: relative;
    z-index: 1;
}

.telomere-strand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 20px 0;
}

.telomere-cap {
    display: flex;
    gap: 3px;
}

.cap-segment {
    width: 10px;
    height: 32px;
    border-radius: 5px;
    background: var(--accent-gold);
    animation: capPulse 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
}

.cap-left .cap-segment {
    opacity: calc(0.3 + var(--i) * 0.14);
}

.cap-right .cap-segment {
    opacity: calc(1 - var(--i) * 0.14);
}

@keyframes capPulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.15); }
}

.telomere-body {
    display: flex;
    gap: 3px;
}

.body-segment {
    width: 14px;
    height: 40px;
    border-radius: 7px;
    background: var(--primary-blue);
    opacity: calc(0.5 + var(--i) * 0.065);
    animation: bodyWave 4s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.15s);
}

@keyframes bodyWave {
    0%, 100% { transform: scaleY(1) translateY(0); }
    25% { transform: scaleY(1.08) translateY(-2px); }
    75% { transform: scaleY(0.95) translateY(2px); }
}

.telomere-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 16px;
}

.telomere-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deep-base);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted-gray);
    font-weight: 500;
}

/* Build List */
.build-list {
    list-style: none;
    position: relative;
    z-index: 1;
}

.build-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(26, 26, 46, 0.06);
    transition: transform 0.3s var(--spring);
}

.build-item:last-child {
    border-bottom: none;
}

.build-item:hover {
    transform: translateX(4px);
}

.build-status-icon {
    flex-shrink: 0;
}

.build-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.build-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--deep-base);
}

.build-time {
    font-size: 0.7rem;
    color: var(--muted-gray);
}

.build-duration {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-gray);
    font-family: monospace;
}

/* Garden Grid */
.garden-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 4px;
    padding: 8px 0;
    position: relative;
    z-index: 1;
}

.garden-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    transition: transform 0.3s var(--elastic), opacity 0.3s ease;
    cursor: pointer;
}

.garden-cell:hover {
    transform: scale(1.4);
    z-index: 2;
}

.garden-cell.dormant {
    background: rgba(26, 26, 46, 0.06);
}

.garden-cell.sprouting {
    background: rgba(168, 197, 160, 0.3);
}

.garden-cell.growing {
    background: rgba(74, 144, 217, 0.4);
}

.garden-cell.blooming {
    background: var(--primary-blue);
}

.garden-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

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

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

.legend-swatch.dormant { background: rgba(26, 26, 46, 0.06); }
.legend-swatch.sprouting { background: rgba(168, 197, 160, 0.3); }
.legend-swatch.growing { background: rgba(74, 144, 217, 0.4); }
.legend-swatch.blooming { background: var(--primary-blue); }

/* Dependencies */
.deps-list {
    position: relative;
    z-index: 1;
}

.dep-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(26, 26, 46, 0.06);
    transition: transform 0.3s var(--spring);
}

.dep-item:last-child {
    border-bottom: none;
}

.dep-item:hover {
    transform: translateX(4px);
}

.dep-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deep-base);
    font-family: monospace;
}

.dep-version {
    font-size: 0.75rem;
    color: var(--muted-gray);
    font-family: monospace;
    margin-right: 12px;
}

.dep-status {
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dep-status.fresh {
    background: rgba(90, 158, 111, 0.1);
    color: #5a9e6f;
}

.dep-status.aging {
    background: rgba(232, 184, 75, 0.15);
    color: #c09a30;
}

.dep-status.wilting {
    background: rgba(192, 86, 79, 0.1);
    color: #c0564f;
}

/* Animations for panels entering view */
.panel, .metric-card {
    animation: panelEnter 0.6s var(--spring) backwards;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.15s; }
.metric-card:nth-child(3) { animation-delay: 0.2s; }
.metric-card:nth-child(4) { animation-delay: 0.25s; }

.dashboard-grid .panel:nth-child(1) { animation-delay: 0.3s; }
.dashboard-grid .panel:nth-child(2) { animation-delay: 0.35s; }
.dashboard-grid .panel:nth-child(3) { animation-delay: 0.4s; }
.dashboard-grid .panel:nth-child(4) { animation-delay: 0.45s; }
.dashboard-grid .panel:nth-child(5) { animation-delay: 0.5s; }

@keyframes panelEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .panel-wide {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 72px;
        padding: 20px 12px;
    }

    .sidebar-logo {
        justify-content: center;
    }

    .logo-text,
    .sidebar-caption,
    .nav-item span {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .bio-strand {
        flex-direction: column;
        align-items: center;
    }

    .strand-segment {
        width: 24px;
        height: 6px;
    }

    .main-content {
        margin-left: 72px;
        padding: 24px 20px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 16px;
    }

    .header-right {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .metrics-row {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .panel-wide {
        grid-column: span 1;
    }

    .garden-grid {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }
}
