/* Core Stylesheet: The Bandwidth Project CSS Design System */

:root {
    --bg-dark: #070913;
    --bg-darker: #04050a;
    --panel-bg: rgba(13, 17, 39, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #38bdf8;
    --accent-green: #10b981;
    --accent-yellow: #facc15;
    --accent-purple: #c084fc;
    --accent-red: #f43f5e;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 10% 20%, rgba(13, 17, 39, 0.8) 0%, var(--bg-darker) 90%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Glassmorphism Panel Utility */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: var(--panel-border-hover);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* App Container */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

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

.logo-orb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    box-shadow: 0 0 12px var(--accent-blue);
    animation: orb-pulse 4s infinite ease-in-out;
}

.logo-orb.large {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    box-shadow: 0 0 24px var(--accent-blue);
}

h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.mono {
    font-family: var(--font-mono);
}

/* Buttons */
.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

.submit-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* Metrics Row */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.metric-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.metric-card h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 8px;
}

.metric-value .period {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.metric-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.text-red {
    color: var(--accent-red);
}

.highlight-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(13, 17, 39, 0.6) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-green));
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease-out;
}

/* Content Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Workspace List */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 99px;
    font-weight: 600;
}

.bg-green {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Service Card style */
.service-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.service-name {
    font-size: 1.125rem;
    font-weight: 700;
}

.service-status-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.service-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.data-item {
    font-size: 0.875rem;
}

.data-label {
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.data-value {
    font-family: var(--font-mono);
    font-weight: 600;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

/* Right Column Panel items */
.workspace-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chart-panel {
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.chart-toggles {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Tables */
.stats-engine-panel {
    padding: 24px;
}

.stats-engine-panel h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
}

td {
    font-weight: 400;
}

/* Predictions container */
.predictions-panel {
    padding: 24px;
}

.predictions-panel h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.prediction-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
}

.prediction-card h4 {
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.prediction-val {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.prediction-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 5, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
}

.brand-center {
    text-align: center;
    margin-bottom: 32px;
}

.brand-center h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.brand-center p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-blue);
}

.error-text {
    font-size: 0.875rem;
    color: var(--accent-red);
    text-align: center;
    margin-top: 8px;
}

.success-text {
    font-size: 0.875rem;
    color: var(--accent-green);
    text-align: center;
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

/* Settings Modal Content */
.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 32px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

/* Animations */
@keyframes orb-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 12px var(--accent-blue);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 20px var(--accent-blue);
    }
}

.animate-scale {
    animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scale-up {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
