﻿/* ============================================
   GLOBAL STYLES - Eureka Sweepers Portal
   ============================================ */

/* CSS Variables */
:root {
    --eureka-green: #04636A;
    --eureka-yellow: #FFEE00;
    --eureka-green-dark: #016369;
    --success-green: #3dcb6c;
    --error-red: #ff3f5f;
    --info-blue: #4a86ff;
    --warning-orange: #ffb545;
    --border-color: #ddd;
    --text-primary: #333;
    --text-secondary: #666;
    --input-bg: #fff;
    --code-bg: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
    --border-radius: 8px;
}

/* Light/Dark Mode Variables */
.light-mode {
    --bg-primary: #04636A;
    --bg-secondary: #FFEE00;
    --text-primary-ui: #FFFFFF;
    --text-secondary-ui: #e8e8e8;
    --drawer-bg: #04636A;
    --drawer-text: #FFFFFF;
    --main-bg-start: #04636A;
    --main-bg-end: #016369;
    --shadow: rgba(0, 0, 0, 0.2);
}

.dark-mode {
    --bg-primary: rgba(4,99,106,0.95);
    --bg-secondary: #FFEE00;
    --text-primary-ui: #FFEE00;
    --text-secondary-ui: #b2b0bf;
    --drawer-bg: rgba(4,99,106,0.95);
    --drawer-text: #FFEE00;
    --main-bg-start: #1a1a27;
    --main-bg-end: #1e1e2d;
    --shadow: rgba(0, 0, 0, 0.4);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    pointer-events: none;
    flex-shrink: 0;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--input-bg);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

    .form-input:focus {
        border-color: var(--eureka-green);
        box-shadow: 0 0 0 2px rgba(4, 99, 106, 0.1);
    }

    .form-input::placeholder {
        color: #aaa;
    }

    .form-input:invalid:not(:placeholder-shown) {
        border-color: var(--error-red);
    }

.validation-message {
    display: block;
    color: var(--error-red);
    font-size: 0.8rem;
    margin-top: 0.375rem;
    min-height: 1.2rem;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.02857em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-primary {
    background-color: var(--eureka-green);
    color: white;
    box-shadow: var(--shadow-light);
}

    .btn-primary:hover:not(:disabled) {
        background-color: #055965;
        box-shadow: var(--shadow-medium);
        transform: translateY(-1px);
    }

    .btn-primary:active:not(:disabled) {
        transform: translateY(0);
    }

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover:not(:disabled) {
        background-color: rgba(0, 0, 0, 0.04);
        border-color: var(--text-secondary);
    }

.btn-success {
    background-color: var(--success-green);
    color: white;
    box-shadow: var(--shadow-light);
}

    .btn-success:hover:not(:disabled) {
        background-color: #2fb85e;
        box-shadow: var(--shadow-medium);
        transform: translateY(-1px);
    }

.btn-full {
    width: 100%;
}

.btn-icon {
    flex-shrink: 0;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ============================================
   ALERT STYLES
   ============================================ */

.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-icon {
    flex-shrink: 0;
}

.alert-error {
    background-color: rgba(255, 63, 95, 0.1);
    color: var(--error-red);
    border-left: 3px solid var(--error-red);
}

.alert-success {
    background-color: rgba(61, 203, 108, 0.1);
    color: var(--success-green);
    border-left: 3px solid var(--success-green);
}

.alert-info {
    background-color: rgba(74, 134, 255, 0.1);
    color: var(--info-blue);
    border-left: 3px solid var(--info-blue);
}

.alert-warning {
    background-color: rgba(255, 181, 69, 0.1);
    color: var(--warning-orange);
    border-left: 3px solid var(--warning-orange);
}

/* ============================================
   CARD STYLES
   ============================================ */

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    padding: 2rem;
    width: 100%;
}

.content-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-heavy);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .content-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    }

/* ============================================
   TABS STYLES (Eureka)
   ============================================ */

.eureka-tabs {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    position: relative;
}

.tabs-header {
    display: flex;
    background-color: var(--eureka-green);
    overflow-x: auto;
    position: relative;
}

    .tabs-header::-webkit-scrollbar {
        height: 4px;
    }

    .tabs-header::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }

    .tabs-header::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

.tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
    outline: none;
}

    .tab:hover {
        background-color: rgba(255, 238, 0, 0.15);
        color: #FFFFFF;
    }

    .tab:focus {
        outline: 2px solid var(--eureka-yellow);
        outline-offset: -2px;
    }

    .tab.active {
        background-color: var(--eureka-yellow);
        color: var(--eureka-green);
        font-weight: 600;
    }

/* ============================================
   NAV MENU STYLES
   ============================================ */

.eureka-navmenu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

    .nav-link:hover {
        background-color: rgba(255, 238, 0, 0.2);
    }

    .nav-link.active {
        background-color: var(--eureka-yellow) !important;
        color: var(--eureka-green) !important;
        font-weight: 600;
    }

    .nav-link.active .nav-icon {
        color: var(--eureka-green) !important;
    }

.nav-link-child {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.nav-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: currentColor;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.12);
    margin: 0.5rem 0;
}

.mode-selector {
    padding: 12px 16px;
    background: rgba(255, 238, 0, 0.1);
    border-radius: 6px;
    margin: 0.5rem;
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-icon {
    flex-shrink: 0;
    color: var(--eureka-yellow);
}

.mode-label {
    flex: 1;
    font-size: 0.8rem;
    color: #e0e0e0;
}

.mode-text {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #888;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--eureka-green);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--eureka-yellow);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--nav-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-align: left;
}

    .nav-group-header:hover {
        background-color: rgba(255, 238, 0, 0.2);
    }

.nav-group-title {
    flex: 1;
}

.expand-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-group.expanded .expand-icon {
    transform: rotate(180deg);
}

.nav-group-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group.expanded .nav-group-content {
    max-height: 1000px;
    margin-top: 0.25rem;
}

.eureka-navmenu::-webkit-scrollbar {
    width: 6px;
}

.eureka-navmenu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.eureka-navmenu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

/* ============================================
   CODE BLOCKS
   ============================================ */

.code-block {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

    .code-block code {
        font-family: 'Courier New', monospace;
        font-size: 0.85rem;
        color: var(--text-primary);
        word-break: break-all;
    }

/* ============================================
   UTILITY CLASSES
   ============================================ */

.spacer {
    flex: 1;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1024px) {
    .tab {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .card,
    .content-card {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    .button-group {
        flex-direction: column;
    }

    .form-input {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .card,
    .content-card {
        padding: 1.25rem;
    }

    .form-input {
        padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    }

    .input-icon {
        left: 10px;
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   BLAZOR ERROR UI
   ============================================ */

#blazor-error-ui {
    background: #ffebee;
    border-top: 2px solid #f44336;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    color: #d32f2f;
}

    #blazor-error-ui .reload,
    #blazor-error-ui .dismiss {
        color: #d32f2f;
        text-decoration: underline;
        cursor: pointer;
        margin-left: 1rem;
    }

    #blazor-error-ui .dismiss {
        text-decoration: none;
        font-weight: bold;
    }
