/* 
 * FleetCharge Unified Test Harness Stylesheet
 * Brand Theme: Full Cohesive SaaS Light Dashboard
 * Accent: Electric Sky Blue
 */

:root {
    --bg-dark: #f8fafc;        /* Soft light slate page background */
    --bg-card: #ffffff;        /* Pure white cards & panels */
    --bg-sidebar: #ffffff;     /* Clean white sidebar */
    --accent-blue: #0284c7;    /* Modern electric sky blue */
    --accent-hover: #0369a1;
    --border-color: #e2e8f0;   /* Light gray divider lines */
    --text-primary: #0f172a;   /* Deep slate for crisp readable text */
    --text-secondary: #475569; /* Slate secondary labels */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    
    /* Env Colors */
    --env-local: #10b981;
    --env-dev: #0ea5e9;
    --env-qa: #f59e0b;
    --env-prod: #ef4444;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Master Layout Grid */
.harness-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "sidebar header"
        "sidebar main"
        "sidebar footer";
    min-height: 100vh;
}

/* Header & Env Indicator */
.harness-header {
    grid-area: header;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.env-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.env-local { color: var(--env-local); background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); }
.env-dev { color: var(--env-dev); background: rgba(14, 165, 233, 0.1); border: 1px solid rgba(14, 165, 233, 0.2); }
.env-qa { color: var(--env-qa); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); }
.env-prod { color: var(--env-prod); background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 4px var(--env-prod); }
    50% { box-shadow: 0 0 12px var(--env-prod); }
    100% { box-shadow: 0 0 4px var(--env-prod); }
}

/* Sidebar (Overhauled to clean light theme) */
.harness-sidebar {
    grid-area: sidebar;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

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

.brand-logo {
    font-size: 1.75rem;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.navigation-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(2, 132, 199, 0.03);
}

.nav-item.active {
    color: var(--accent-blue);
    background-color: rgba(2, 132, 199, 0.07);
    font-weight: 600;
    border-left: 3px solid var(--accent-blue);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Panels inside light sidebar */
.auth-panel {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.auth-panel h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.auth-field {
    margin-bottom: 12px;
}

.auth-field:last-child {
    margin-bottom: 0;
}

.auth-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Overhauled auth input boxes to modern light styling */
.auth-field input, .auth-field input[type="text"] {
    width: 100%;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    color: var(--text-primary) !important;
    font-size: 0.8rem !important;
    outline: none !important;
    transition: all 0.2s;
}

.auth-field input:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1) !important;
}

/* Content Frame */
.harness-main {
    grid-area: main;
    padding: 32px;
    overflow-y: auto;
}

/* Interactive elements / cards in content area */
.fc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.fc-card h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Data Tables */
.fc-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #ffffff;
}

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

.fc-table th {
    background: #f8fafc;
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.fc-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.fc-table tr:last-child td {
    border-bottom: none;
}

.fc-table tr:hover td {
    background: #f1f5f9;
}

/* Forms & Inputs */
.fc-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.fc-input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fc-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.fc-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

/* Custom Styled Buttons */
.fc-btn {
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.fc-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

.fc-btn:active {
    transform: translateY(1px);
}

.fc-btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    box-shadow: none;
}

.fc-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: none;
}

/* Badge Styles */
.fc-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Live Logs Accordion Panel - Modern light developer styling */
.harness-footer {
    grid-area: footer;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
}

.log-accordion-trigger {
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
}

.log-accordion-trigger h3 {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-accordion-content {
    height: 300px;
    background-color: #f8fafc; /* Modern light terminal background */
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
    transition: height 0.25s ease-out;
}

.log-accordion-content.collapsed {
    height: 0;
    border-top: none;
}

.log-terminal-header {
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
}

.log-terminal {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 24px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    color: #334155; /* Dark gray clean text color */
}

.log-line {
    margin-bottom: 6px;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-time {
    color: #94a3b8;
    margin-right: 8px;
}

/* Light Mode Badges for syntax logging */
.log-tag {
    font-weight: bold;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.log-tag-system { background: rgba(71, 85, 105, 0.1); color: #475569; }
.log-tag-api { background: rgba(13, 148, 136, 0.1); color: #0d9488; }
.log-tag-kafka { background: rgba(180, 83, 9, 0.1); color: #b45309; }
.log-tag-error { background: rgba(225, 29, 72, 0.1); color: #e11d48; }
.log-tag-info { background: rgba(100, 116, 139, 0.1); color: #64748b; }

/* ----------------------------------------------------
 * High-End Lightbox/Modal Overlays for JSON Inspection
 * ---------------------------------------------------- */
.fc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4); /* Modern slate mask overlay */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 24px;
}

.fc-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: scaleUp 0.15s ease-out;
}

@keyframes scaleUp {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.fc-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.fc-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.fc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    background: #ffffff;
}

.fc-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

/* Standardized Loader Spinner */
@keyframes fc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.fc-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(2, 132, 199, 0.15);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: fc-spin 0.8s linear infinite;
}
.fc-spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}
