/**
 * Chain360 - Main Stylesheet
 * City of Johannesburg Asset Management System
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
   :root {
    --color-deep-midnight: #0A0D15;
    --color-dark-surface: #1C202B;
    --color-electric-aqua: #00F0FF;
    --color-flow-primary: #00BFFF;
    --color-text-light: #E0E7FF;
    --color-text-mono: #A9B3C7;
    --color-error: #FF4757;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */
html {
    font-size: 14px; /* Down from browser default 16px — scales all rem values proportionally */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--color-deep-midnight);
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    line-height: 1.2;
}

h1 {
    font-size: 4vw;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.hero-left h1 {
    font-size: 4.5vw;
    margin-bottom: 30px;
}

.hero-left p {
    font-size: 1.1rem;
    max-width: 550px;
    margin-bottom: 40px;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
}

p {
    font-weight: 300;
    color: var(--color-text-mono);
}

.subtitle {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--color-electric-aqua);
    text-transform: uppercase;
    letter-spacing: 4px;
}

/* ============================================================================
   BRAND ELEMENTS
   ============================================================================ */
.brand-logo {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    z-index: 100;
    color: var(--color-electric-aqua);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--color-electric-aqua);
    color: var(--color-deep-midnight);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.7);
    padding: 14px 40px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.9);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-login {
    width: auto;
    max-width: 100%;
    padding: 14px 40px;
    background: var(--color-electric-aqua);
    color: var(--color-deep-midnight);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.7);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.9);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--color-electric-aqua);
    border: 2px solid var(--color-flow-primary);
}

.btn-secondary:hover {
    background: rgba(0, 191, 255, 0.1);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-mono);
    margin-bottom: 8px;
    font-family: 'Roboto Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    max-width: 500px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 10px;
    color: var(--color-text-light);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-electric-aqua);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================================================
   MESSAGES & ALERTS
   ============================================================================ */
.message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--color-error);
    color: var(--color-error);
}

.success-message {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.warning-message {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid var(--color-warning);
    color: var(--color-warning);
}

/* ============================================================================
   HERO SECTION (Login, Landing pages)
   ============================================================================ */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8vw 0 10vw;
    text-align: left;
    z-index: 20;
    background: radial-gradient(circle at 10% 50%, rgba(0, 240, 255, 0.05) 0%, transparent 40%);
}

.hero-right {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* Glassmorphism Login Box */
.login-box {
    background: rgba(28, 32, 43, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 0 60px rgba(0, 240, 255, 0.05);
    max-width: 500px;
    margin-top: 20px;
}

/* ============================================================================
   FLOW CORE (Animated Logo Circle)
   ============================================================================ */
.flow-core {
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: var(--color-dark-surface);
    position: relative;
    box-shadow:
        -20px -20px 60px rgba(255, 255, 255, 0.05),
         20px 20px 60px rgba(0, 0, 0, 0.8),
         0 0 100px rgba(0, 191, 255, 0.3);
    animation: breathe 10s ease-in-out infinite;
}

.flow-core::before {
    content: '';
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    border: 2px solid var(--color-flow-primary);
    box-shadow: 0 0 50px var(--color-electric-aqua);
    opacity: 0.5;
    animation: pulse 4s ease-out infinite;
}

.core-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    opacity: 0.9;
    filter: drop-shadow(0 0 15px var(--color-electric-aqua));
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ============================================================================
   DASHBOARD LAYOUT
   ============================================================================ */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--color-dark-surface);
    padding: 30px 20px;
    border-right: 1px solid rgba(0, 191, 255, 0.1);
    position: relative;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(0, 191, 255, 0.1);
}

.sidebar-logo-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--color-dark-surface);
    position: relative;
    box-shadow:
        -5px -5px 20px rgba(255, 255, 255, 0.03),
         5px 5px 20px rgba(0, 0, 0, 0.5),
         0 0 40px rgba(0, 191, 255, 0.2);
    animation: breathe 10s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-circle::before {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px solid var(--color-flow-primary);
    box-shadow: 0 0 30px var(--color-electric-aqua);
    opacity: 0.5;
    animation: pulse 4s ease-out infinite;
}

.sidebar-logo-circle img {
    width: 60%;
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 8px var(--color-electric-aqua));
}

.sidebar-header {
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(0, 191, 255, 0.1);
}

.sidebar-section {
    margin-top: 30px;
}

.sidebar-section-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--color-text-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-left: 16px;
}

.main-content {
    padding: 20px 40px 40px 40px;
    background: var(--color-deep-midnight);
}

.top-nav-bar {
    background: var(--color-dark-surface);
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 30px;
    box-shadow: 
        -5px -5px 20px rgba(255, 255, 255, 0.02),
        5px 5px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav-left h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.top-nav-left p {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 191, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.notification-icon:hover {
    background: rgba(0, 191, 255, 0.2);
    transform: scale(1.05);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--color-dark-surface);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
}

.user-profile:hover {
    background: rgba(28, 32, 43, 0.8);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-electric-aqua), var(--color-flow-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--color-deep-midnight);
    font-size: 1.2rem;
}

.user-dropdown {
    position: absolute;
    top: 70px;
    right: 0;
    background: var(--color-dark-surface);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 191, 255, 0.05);
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: rgba(0, 191, 255, 0.1);
    color: var(--color-electric-aqua);
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(0, 191, 255, 0.1);
    margin: 5px 0;
}

/* Chart Container */
.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}

.chart-canvas {
    width: 100%;
    height: 100%;
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: var(--color-dark-surface);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 
        -5px -5px 20px rgba(255, 255, 255, 0.02),
        5px 5px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.card-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-electric-aqua);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-dark-surface);
    border-radius: 15px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.content-card {
    background: var(--color-dark-surface);
    border-radius: 15px;
    padding: 25px 30px;
    box-shadow:
        -5px -5px 20px rgba(255, 255, 255, 0.02),
        5px 5px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-electric-aqua), var(--color-flow-primary));
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-mono);
    font-weight: 500;
}

.stat-trend {
    font-size: 0.85rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-trend.up {
    color: var(--color-success);
}

.stat-trend.down {
    color: var(--color-error);
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.activity-item:hover {
    background: rgba(0, 191, 255, 0.05);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-icon.running {
    background: rgba(0, 191, 255, 0.2);
}

.activity-icon.completed {
    background: rgba(46, 204, 113, 0.2);
}

.activity-icon.pending {
    background: rgba(243, 156, 18, 0.2);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.activity-meta {
    font-size: 0.85rem;
    color: var(--color-text-mono);
}

.activity-status {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running {
    background: rgba(0, 191, 255, 0.2);
    color: var(--color-flow-primary);
}

.status-completed {
    background: rgba(46, 204, 113, 0.2);
    color: var(--color-success);
}

.status-pending {
    background: rgba(243, 156, 18, 0.2);
    color: var(--color-warning);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============================================================================
   TABLES
   ============================================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-dark-surface);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: rgba(0, 191, 255, 0.1);
}

th {
    padding: 15px;
    text-align: left;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-electric-aqua);
}

td {
    padding: 15px;
    border-top: 1px solid rgba(0, 191, 255, 0.05);
}

tr:hover {
    background: rgba(0, 191, 255, 0.05);
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */
.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color-text-mono);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-link:hover {
    background: rgba(0, 191, 255, 0.1);
    color: var(--color-electric-aqua);
}

.nav-link.active {
    background: rgba(0, 191, 255, 0.15);
    color: var(--color-electric-aqua);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--color-electric-aqua);
    border-radius: 0 2px 2px 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-error);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }
.p-4 { padding: 40px; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* ── Dashboard heading overrides — scoped so the login hero is unaffected ── */
.dashboard-content h1 {
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: none;
}

.dashboard-content h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.dashboard-content h3 {
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-content h4 {
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-left {
        text-align: center;
        padding: 10vw 5vw;
    }

    .hero-right {
        display: none;
    }

    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    h1 {
        font-size: 2rem;
    }
}