/* ========================================
   recycle.studio -- Dopamine Dashboard Studio
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --lavender: #F0E8FF;
    --deep-violet: #2D1B4E;
    --muted-purple: #6B5A8A;
    --pastel-pink: #FFB8D4;
    --pastel-mint: #B8FFD4;
    --pastel-yellow: #FFF5B8;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-layered: 0 4px 6px rgba(0,0,0,0.05), 0 10px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 16px rgba(0,0,0,0.08), 0 20px 40px rgba(0,0,0,0.12);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted-purple);
    background-color: var(--lavender);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Header --- */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    background: rgba(240, 232, 255, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(107, 90, 138, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--deep-violet);
    letter-spacing: -0.01em;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-pill {
    padding: 0.45rem 1.1rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-purple);
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.nav-pill:hover {
    background: rgba(255, 184, 212, 0.25);
    color: var(--deep-violet);
}

.nav-pill.active {
    background: var(--pastel-pink);
    color: var(--deep-violet);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-areas:
        "hero    hero    hero    hero    hero    hero    hero    hero    tools   tools   tools   tools"
        "activ   activ   activ   prog    prog    prog    prog    lib     lib     lib     lib     lib"
        "quote   quote   quote   quote   quote   quote   quote   quote   quote   quote   quote   quote";
    gap: 1.5rem;
    padding: 2rem 2.5rem;
    max-width: 1440px;
    margin: 0 auto;
}

/* --- Panels (shared) --- */
.panel {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--shadow-layered);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    position: relative;
    overflow: hidden;
}

.panel:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow: var(--shadow-hover);
}

.panel-inner {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.panel h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    color: var(--deep-violet);
    margin-bottom: 1.25rem;
}

/* --- Panel: Hero --- */
.panel-hero {
    grid-area: hero;
    background: linear-gradient(135deg, #ffffff 0%, rgba(240, 232, 255, 0.5) 100%);
}

.panel-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--deep-violet);
    line-height: 1.15;
    margin-bottom: 1rem;
}

.panel-hero .accent-text {
    color: var(--pastel-pink);
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--muted-purple);
    max-width: 520px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-bubble {
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 120px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-bubble:hover {
    transform: scale(1.08);
}

.stat-pink { background: rgba(255, 184, 212, 0.3); }
.stat-mint { background: rgba(184, 255, 212, 0.3); }
.stat-yellow { background: rgba(255, 245, 184, 0.3); }

.stat-number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--deep-violet);
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted-purple);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Panel: Tools --- */
.panel-tools {
    grid-area: tools;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.tool-card {
    background: var(--lavender);
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 184, 212, 0.15);
}

.tool-svg {
    margin-bottom: 0.75rem;
    display: block;
}

.tool-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--deep-violet);
    margin-bottom: 0.35rem;
}

.tool-card p {
    font-size: 0.82rem;
    color: var(--muted-purple);
    line-height: 1.5;
}

/* --- Panel: Activity --- */
.panel-activity {
    grid-area: activ;
}

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(107, 90, 138, 0.08);
}

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

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-pink { background: var(--pastel-pink); }
.dot-mint { background: var(--pastel-mint); }
.dot-yellow { background: var(--pastel-yellow); }

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.activity-content strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--deep-violet);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--muted-purple);
    opacity: 0.7;
}

/* --- Panel: Progress --- */
.panel-progress {
    grid-area: prog;
    text-align: center;
}

.progress-ring-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.progress-ring {
    display: block;
}

.progress-ring-fill {
    stroke-dasharray: 314.16;
    stroke-dashoffset: 314.16;
}

.progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-percent {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--deep-violet);
    line-height: 1;
}

.progress-sublabel {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-purple);
    margin-top: 0.2rem;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-cat {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-purple);
    min-width: 80px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--lavender);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fill-pink { background: var(--pastel-pink); }
.fill-mint { background: var(--pastel-mint); }
.fill-yellow { background: var(--pastel-yellow); }

/* --- Panel: Library --- */
.panel-library {
    grid-area: lib;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.library-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border-radius: 14px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    text-align: center;
}

.library-item:hover {
    transform: scale(1.06);
}

.item-pink { background: rgba(255, 184, 212, 0.2); }
.item-mint { background: rgba(184, 255, 212, 0.2); }
.item-yellow { background: rgba(255, 245, 184, 0.2); }
.item-lavender { background: rgba(240, 232, 255, 0.5); }

.library-item span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--deep-violet);
}

.library-item em {
    font-style: normal;
    font-size: 0.75rem;
    color: var(--muted-purple);
}

/* --- Panel: Quote --- */
.panel-quote {
    grid-area: quote;
    background: linear-gradient(135deg, var(--deep-violet) 0%, var(--muted-purple) 100%);
    text-align: center;
}

.panel-quote .panel-inner {
    padding: 2.5rem 3rem;
}

.quote-icon {
    margin-bottom: 1rem;
    opacity: 0.6;
}

.panel-quote blockquote {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.15rem, 2.5vw, 1.75rem);
    color: #ffffff;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto 0.75rem;
}

.panel-quote cite {
    font-style: normal;
    font-size: 0.85rem;
    color: var(--pastel-pink);
    letter-spacing: 0.02em;
}

/* --- Footer --- */
.dashboard-footer {
    text-align: center;
    padding: 2rem 2.5rem;
    font-size: 0.82rem;
    color: var(--muted-purple);
    opacity: 0.7;
}

/* --- Path-Draw SVG Animation --- */
.path-draw {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.path-draw.drawn {
    stroke-dashoffset: 0;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "hero    hero"
            "tools   tools"
            "activ   prog"
            "lib     lib"
            "quote   quote";
        padding: 1.5rem;
    }

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

@media (max-width: 700px) {
    .dashboard-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "tools"
            "activ"
            "prog"
            "lib"
            "quote";
        gap: 1rem;
        padding: 1rem;
    }

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

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

    .hero-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-bubble {
        flex-direction: row;
        justify-content: space-between;
    }

    .panel-quote .panel-inner {
        padding: 2rem 1.5rem;
    }
}
