@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --primary-color: #72BF44;
    /* Brand Green */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-glow: rgba(114, 191, 68, 0.4);
    /* Kept from original */
    --glass-bg: rgba(255, 255, 255, 0.03);
    /* Kept from original */
    --glass-border: rgba(255, 255, 255, 0.08);
    /* Kept from original */
    --glass-blur: 12px;
    /* Kept from original */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.globe-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    top: -200px;
    left: -100px;
    animation: float 20s infinite alternate;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(66, 133, 244, 0.15), transparent 70%);
    bottom: -100px;
    right: -100px;
    animation: float 15s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Common Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-text:hover {
    color: var(--text-primary);
}

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

/* Views */
.view-container {
    display: none;
    min-height: 100vh;
}

.view-container.active {
    display: flex;
}

/* Login View */
#login-view {
    align-items: center;
    justify-content: center;
}

.login-card {
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 48px 32px;
}

.logo-area {
    margin-bottom: 32px;
}

.logo-area h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.error-msg {
    color: #ff6b6b;
    margin-top: 16px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Dashboard View */
#dashboard-view {
    flex-direction: column;
}

.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(10px);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

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

/* Controls Toolbar */
.controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 16px 10px 40px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 0.8rem;
}

.glass-select {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.glass-select:focus {
    border-color: var(--accent);
}

.btn-icon {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(114, 191, 68, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 8px;
    color: var(--accent);
}

.charts-grid {
    margin-bottom: 32px;
}

.chart-container {
    height: 400px;
    position: relative;
}

.data-table-container h3 {
    margin-bottom: 16px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

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

/* Responsive */
@media (max-width: 768px) {
    .glass-nav {
        padding: 16px 20px;
    }

    .dashboard-content {
        padding: 20px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-box {
        flex-grow: 1;
    }
}

/* Pipeline Visualization */
.pipeline-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    overflow-x: auto;
}

.pipeline-step {
    text-align: center;
    min-width: 100px;
    position: relative;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.pipeline-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.step-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.pipeline-step.completed .step-count {
    color: var(--primary-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card {
    width: 90%;
    max-width: 600px;
    background: #111;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-card textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    color: #0f0;
    /* Matrix green for code feel */
    font-family: monospace;
    font-size: 0.9rem;
    margin-bottom: 20px;
    outline: none;
    resize: vertical;
}

.modal-card textarea:focus {
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    align-items: center;
}