/* Palette Reference:
   Background Light: #F0F0F0, Background White: #FFFFFF, Secondary: #F5F5F5,
   Sidebar Dark: #1A1A1A, Sidebar Text: #E0E0E0,
   Bauhaus Red: #E63946, Bauhaus Blue: #1D3557, Bauhaus Yellow: #F4A261,
   Text Primary: #1A1A1A, Text Secondary: #333333, Text Muted: #777777,
   Grid Line: #D5D5D5
*/

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

body {
    background-color: #F0F0F0;
    color: #333333;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #1A1A1A;
    color: #E0E0E0;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.02em;
}

.sidebar-rule {
    border: none;
    border-top: 1px solid #333333;
    margin: 16px 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    text-decoration: none;
    color: #E0E0E0;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease-out;
}

.nav-item:hover {
    color: #FFFFFF;
}

/* Bauhaus Shapes */
.shape {
    display: inline-block;
    flex-shrink: 0;
}

.shape-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #E63946;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid #F4A261;
}

.shape-square {
    width: 20px;
    height: 20px;
    background-color: #1D3557;
}

.shape-sm {
    transform: scale(0.5);
}

.shape-lg {
    transform: scale(1.6);
}

/* Sidebar Dials */
.sidebar-dials {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: auto;
}

.dial-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dial {
    width: 48px;
    height: 48px;
}

.dial-label {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #777777;
    letter-spacing: 0.02em;
}

.dial-fill {
    transition: stroke-dashoffset 1200ms ease-out;
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    padding: 32px;
    min-width: 0;
}

/* Grid Underlay */
.grid-underlay {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(213, 213, 213, 0.4) 0px,
            rgba(213, 213, 213, 0.4) 1px,
            transparent 1px,
            transparent calc((100% - 11 * 16px) / 12 + 16px)
        );
    background-size: calc((100% - 280px - 64px) / 12 + 16px) 100%;
    background-position: 32px 0;
}

/* Modules */
.module {
    position: relative;
    z-index: 1;
}

.module-full {
    background-color: #FFFFFF;
    border-radius: 4px;
    padding: 40px 32px;
    margin-bottom: 16px;
}

.module-blue {
    border-top: 3px solid #1D3557;
}

.module-red {
    border-top: 3px solid #E63946;
}

.module-yellow {
    border-top: 3px solid #F4A261;
}

.module-title-primary {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.module-subtitle {
    font-size: 15px;
    color: #777777;
    max-width: 640px;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.module-card {
    background-color: #FFFFFF;
    border-radius: 4px;
    padding: 24px;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.module-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #1A1A1A;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.module-body {
    font-size: 15px;
    color: #333333;
    line-height: 1.65;
    margin-bottom: 16px;
}

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

/* Bar Charts */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar {
    height: 8px;
    border-radius: 2px;
    transition: width 800ms ease-out;
}

.bar-red {
    background-color: #E63946;
}

.bar-blue {
    background-color: #1D3557;
}

.bar-yellow {
    background-color: #F4A261;
}

.bar-label {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #777777;
    letter-spacing: 0.02em;
    min-width: 36px;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.module-wide {
    min-width: 0;
}

.module-narrow {
    min-width: 0;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #777777;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #D5D5D5;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.data-table td {
    padding: 10px 12px;
    color: #333333;
    border-bottom: 1px solid #F0F0F0;
}

.data-table tbody tr:nth-child(odd) {
    background-color: #FFFFFF;
}

.data-table tbody tr:nth-child(even) {
    background-color: #F5F5F5;
}

.mono-data {
    font-family: 'Fira Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.02em;
}

/* Large Dial */
.large-dial-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px auto;
    width: 120px;
    height: 120px;
}

.large-dial {
    width: 120px;
    height: 120px;
}

.dial-fill-large {
    transition: stroke-dashoffset 1500ms ease-out;
}

.large-dial-value {
    position: absolute;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
}

/* Summary */
.summary-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.summary-shapes {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-bottom: 24px;
}

/* Footer */
.footer-strip {
    background-color: #1A1A1A;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -32px -32px -32px;
    border-radius: 0 0 4px 4px;
}

.footer-domain {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #777777;
}

/* Animations */
.slide-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
    transition-delay: var(--delay, 0ms);
}

.slide-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-reveal {
    opacity: 0;
    transition: opacity 800ms ease-out;
}

.fade-reveal.visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 60px;
        min-width: 60px;
        padding: 16px 8px;
        align-items: center;
    }

    .sidebar-brand {
        font-size: 0;
        width: 20px;
        height: 20px;
        background-color: #E63946;
        border-radius: 50%;
    }

    .nav-label {
        display: none;
    }

    .dial-label {
        display: none;
    }

    .grid-underlay {
        left: 60px;
    }

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

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