/* Full-Stack Architecture Diagram Styles */
:root {
    --primary: rgb(30, 75, 105);
    --accent: rgb(70, 180, 200);
    --bg: #f5f7fa;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;

    --color-user: #bfdbfe;
    --color-user-border: #93c5fd;
    --color-frontend: #3b82f6;
    --color-frontend-light: #dbeafe;
    --color-backend: #22c55e;
    --color-backend-light: #dcfce7;
    --color-database: #f59e0b;
    --color-database-light: #fef3c7;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: #1e293b;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Layer styles */
.layer {
    width: 100%;
    border-radius: 10px;
    padding: 16px 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    border: 2px solid transparent;
}

.layer:hover {
    transform: scale(1.015);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.layer.active {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(30, 75, 105, 0.25);
}

#layer-user {
    background: var(--color-user);
    border-color: var(--color-user-border);
}
#layer-user.active {
    border-color: var(--primary);
}

#layer-frontend {
    background: var(--color-frontend-light);
    border-color: #93c5fd;
}
#layer-frontend.active {
    border-color: var(--primary);
}

#layer-backend {
    background: var(--color-backend-light);
    border-color: #86efac;
}
#layer-backend.active {
    border-color: var(--primary);
}

#layer-database {
    background: var(--color-database-light);
    border-color: #fde68a;
}
#layer-database.active {
    border-color: var(--primary);
}

/* Layer header */
.layer-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.layer-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.layer-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.layer-tagline {
    font-size: 0.82rem;
    color: #475569;
    font-style: italic;
}

/* Layer body - shown on hover */
.layer-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}

.layer:hover .layer-body {
    max-height: 200px;
    opacity: 1;
}

.layer-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-col h3 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    margin-bottom: 6px;
}

.detail-col ul {
    list-style: none;
    padding: 0;
}

.detail-col li {
    font-size: 0.85rem;
    color: #334155;
    padding: 2px 0;
    padding-left: 12px;
    position: relative;
}

.detail-col li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.example-text {
    font-size: 0.85rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    line-height: 1.4;
}

/* PM Discussion Points */
.pm-points {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-top: 0;
    background: rgba(30, 75, 105, 0.06);
    border-radius: 8px;
}

.layer.active .pm-points {
    max-height: 250px;
    opacity: 1;
    margin-top: 12px;
    padding: 12px 16px;
}

.pm-points h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pm-points ul {
    list-style: none;
    padding: 0;
}

.pm-points li {
    font-size: 0.84rem;
    color: #334155;
    padding: 4px 0 4px 18px;
    position: relative;
    line-height: 1.4;
}

.pm-points li::before {
    content: "\25B6";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.65rem;
    top: 7px;
}

/* Arrows */
.arrow-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    padding: 4px 0;
    position: relative;
}

.arrow-down,
.arrow-up {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.arrow-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .layer-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .arrow-container {
        gap: 40px;
    }

    .arrow-label {
        font-size: 0.65rem;
    }
}
