/* Pantheon Common Styles
 * Shared CSS for all Pantheon UI pages
 */

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

/* Base Typography */
body {
    font-family: 'Space Grotesk', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* Links */
a {
    color: #60a5fa;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}
.container.narrow { max-width: 600px; }
.container.wide { max-width: 1200px; }

/* Cards */
.card {
    background: #1e293b;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}
.card p {
    color: #94a3b8;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-logout {
    background: transparent;
    color: #94a3b8;
    padding: 0.5rem 1rem;
}
.btn-logout:hover { color: #e2e8f0; }
.btn-sm { padding: 0.5rem 0.75rem; font-size: 0.875rem; }
.btn-full { width: 100%; }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-error { background: #991b1b; color: #fca5a5; }
.alert-success { background: #166534; color: #4ade80; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green { background: #166534; color: #4ade80; }
.badge-yellow { background: #854d0e; color: #facc15; }
.badge-red { background: #991b1b; color: #fca5a5; }
.badge-blue { background: #1e40af; color: #93c5fd; }
.badge-gray { background: #334155; color: #94a3b8; }

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #334155;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.tab {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.875rem;
}
.tab:hover { background: #334155; }
.tab.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Page-level tabs (admin/monitoring top navigation) */
.tabs-page {
    background: #1e293b;
    margin-bottom: 0;
}
.tabs-page .tab {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.chart-controls label {
    color: #94a3b8;
    font-size: 0.875rem;
    margin: 0;
}
.chart-controls select {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    min-width: 0;
    width: auto;
}

/* Button Group (toggle buttons) */
.btn-group {
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
}
.btn-group .btn-toggle {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid #475569;
    background: #1e293b;
    color: #94a3b8;
    cursor: pointer;
    border-right: none;
}
.btn-group .btn-toggle:last-child { border-right: 1px solid #475569; }
.btn-group .btn-toggle:hover { background: #334155; }
.btn-group .btn-toggle.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* Code Blocks */
pre {
    background: #0f172a;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}
code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.code-label {
    font-size: 0.75rem;
    color: #64748b;
}
.copy-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: #334155;
    border: none;
    border-radius: 4px;
    color: #e2e8f0;
    cursor: pointer;
}
.copy-btn:hover { background: #475569; }
.copy-btn.copied { background: #166534; }

/* Form Elements */
input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #0f172a;
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-size: 1rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Key Display */
.key-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.key-display input {
    font-family: monospace;
    flex: 1;
    margin-bottom: 0;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
    background: #1e293b;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: #e2e8f0; }

/* Alert Modal */
.modal-alert .modal-content {
    max-width: 400px;
    padding: 0;
    overflow: hidden;
}
.modal-alert-bar {
    height: 4px;
}
.modal-alert-bar.alert-error { background: #ef4444; }
.modal-alert-bar.alert-success { background: #22c55e; }
.modal-alert-bar.alert-info { background: #3b82f6; }
.modal-alert-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
}
.modal-alert-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1.5;
}
.modal-alert-icon.alert-error { color: #ef4444; }
.modal-alert-icon.alert-success { color: #22c55e; }
.modal-alert-icon.alert-info { color: #3b82f6; }
.modal-alert-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}
.modal-alert-close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.modal-alert-close:hover { color: #e2e8f0; }

/* Confirm Modal */
.modal-confirm .modal-content {
    max-width: 420px;
    padding: 0;
    overflow: hidden;
}
.modal-confirm-bar {
    height: 4px;
    background: #f59e0b;
}
.modal-confirm-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 1rem;
}
.modal-confirm-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1.5;
    color: #f59e0b;
}
.modal-confirm-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}
.modal-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0 1.5rem 1.25rem;
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #334155;
}
th { color: #94a3b8; font-weight: 500; }
tr:hover { background: #334155; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: bold; color: #3b82f6; }
.stat-label { color: #94a3b8; margin-top: 0.5rem; }

/* User Header */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}
.user-details h3 { font-size: 1rem; }
.user-details p {
    font-size: 0.75rem;
    color: #64748b;
}

/* Steps */
.steps {
    counter-reset: step;
}
.step {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}
.step h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}
.step p {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 0.875rem;
}
footer a { color: #3b82f6; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Navigation Drawer */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}
.hamburger:hover { background: #334155; }
.hamburger span {
    width: 24px;
    height: 2px;
    background: #e2e8f0;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 100;
}
.nav-overlay.active { opacity: 1; visibility: visible; }
.nav-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #1e293b;
    transition: right 0.3s;
    z-index: 101;
    display: flex;
    flex-direction: column;
}
.nav-drawer.active { right: 0; }
.nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-header h3 { font-size: 1rem; margin: 0; }
.nav-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}
.nav-close:hover { color: #e2e8f0; }
.nav-menu {
    flex: 1;
    padding: 1rem 0;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.nav-item:hover { background: #334155; color: #e2e8f0; }
.nav-item.active { color: #3b82f6; background: rgba(59,130,246,0.1); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-divider {
    height: 1px;
    background: #334155;
    margin: 0.5rem 0;
}

/* Auth/Login Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.auth-container.hidden { display: none; }
.auth-box {
    background: #1e293b;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}
.auth-box h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }

/* App Container */
.app-container { display: none; }
.app-container.active { display: block; }

/* Page Sections & Panels */
.page-section { display: none; }
.page-section.active { display: block; }
.panel { display: none; }
.panel.active { display: block; }

/* Admin Header */
.admin-header {
    background: #1e293b;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}
.admin-header h1 { font-size: 1.25rem; margin: 0; }

/* Chart Cards */
.chart-card {
    background: #1e293b;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.chart-card h3 { margin-bottom: 1rem; font-size: 1rem; }

/* Filters */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-group label {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}
.filter-group select, .filter-group input {
    width: auto;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    margin: 0;
}

/* Main Content */
main { padding: 2rem; max-width: 1200px; margin: 0 auto; }

/* Google Button */
.btn-google {
    background: white;
    color: #1f2937;
    width: 100%;
    border: 1px solid #e5e7eb;
}
.btn-google:hover { background: #f3f4f6; }
.google-icon {
    width: 18px;
    height: 18px;
}

/* Error Card */
.error-card {
    background: #1e293b;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}
.error-card h2 {
    color: #f87171;
    margin-bottom: 1rem;
}
.error-card p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}
.error-card .btn {
    margin: 0.5rem;
}

/* Pantheon Branding */
.pantheon-header-lg {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 2.3rem;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
}

.pantheon-header {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.8rem;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
}

/* Utility Classes */
.hidden { display: none !important; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.actions { display: flex; gap: 0.5rem; }
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}
.loading {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}
