/* Tech/Security Theme - Replaces Neumorphism */

/* Global Variables & Theme Colors */
:root {
    /* Default to Light Tech (Clean, Enterprise) */
    --tech-bg: #f1f5f9;
    --tech-surface: rgba(255, 255, 255, 0.9);
    --tech-surface-border: rgba(226, 232, 240, 0.8);
    --tech-primary: #0ea5e9; /* Sky 500 */
    --tech-primary-glow: rgba(14, 165, 233, 0.25);
    --tech-text-main: #0f172a;
    --tech-text-muted: #64748b;
    --tech-input-bg: #ffffff;
    --tech-grid-color: rgba(148, 163, 184, 0.15);
    
    /* Legacy mapping for compatibility */
    --neu-bg: var(--tech-bg);
    --neu-surface: var(--tech-surface);
    --neu-primary: var(--tech-primary);
    --neu-text-primary: var(--tech-text-main);
    --neu-text-secondary: var(--tech-text-muted);
}

html.dark-mode, [data-theme="dark"], .mud-theme-dark {
    /* Dark Tech (Cyber Security) */
    --tech-bg: #0b1121; /* Darker Slate */
    --tech-surface: rgba(30, 41, 59, 0.6); /* Glassy Slate 800 */
    --tech-surface-border: rgba(56, 189, 248, 0.15); /* Subtle Blue Border */
    --tech-primary: #38bdf8; /* Sky 400 */
    --tech-primary-glow: rgba(56, 189, 248, 0.4);
    --tech-text-main: #f8fafc;
    --tech-text-muted: #94a3b8;
    --tech-input-bg: rgba(15, 23, 42, 0.6);
    --tech-grid-color: rgba(56, 189, 248, 0.08);

    /* Legacy mapping */
    --neu-bg: var(--tech-bg);
    --neu-surface: var(--tech-surface);
    --neu-primary: var(--tech-primary);
    --neu-text-primary: var(--tech-text-main);
    --neu-text-secondary: var(--tech-text-muted);
}

/* Background Grid Effect */
body {
    background-color: var(--tech-bg) !important;
    background-image: 
        linear-gradient(var(--tech-grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--tech-grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    min-height: 100vh;
}

/* Vignette Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 0%, var(--tech-bg) 120%);
    pointer-events: none;
    z-index: -1;
}

/* Tech Card Container */
.tech-card {
    background: var(--tech-surface) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--tech-surface-border) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 16px !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle accent line at top of card */
.tech-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tech-primary), transparent);
    opacity: 0.5;
}

/* Tech Input Fields */
.tech-input .mud-input-control {
    margin-top: 0;
}

.tech-input .mud-input-slot {
    background: var(--tech-input-bg) !important;
    border: 1px solid var(--tech-surface-border) !important;
    border-radius: 8px !important;
    color: var(--tech-text-main) !important;
    transition: all 0.3s ease;
}

.tech-input .mud-input-slot:focus-within {
    border-color: var(--tech-primary) !important;
    box-shadow: 0 0 0 1px var(--tech-primary), 0 0 15px var(--tech-primary-glow) !important;
}

.tech-input .mud-input-label {
    color: var(--tech-text-muted) !important;
}

.tech-input .mud-icon-root {
    color: var(--tech-text-muted) !important;
}

.tech-input.mud-input-input-control.mud-input-error .mud-input-slot {
    border-color: #ef4444 !important; /* Red 500 */
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2) !important;
}

/* Tech Buttons */
.tech-button-primary {
    background: var(--tech-primary) !important;
    color: #0f172a !important; /* Always dark text on bright button for contrast */
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 6px !important;
    border: none !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-button-primary:hover {
    box-shadow: 0 0 20px var(--tech-primary-glow) !important;
    filter: brightness(1.1);
}

.tech-button-primary:active {
    transform: scale(0.98);
}

.tech-button-outlined {
    border: 1px solid var(--tech-surface-border) !important;
    color: var(--tech-text-main) !important;
    background: transparent !important;
    border-radius: 6px !important;
    transition: all 0.2s ease;
}

.tech-button-outlined:hover {
    border-color: var(--tech-primary) !important;
    background: rgba(56, 189, 248, 0.05) !important;
    color: var(--tech-primary) !important;
}

/* Tech Alert */
.tech-alert {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
    border-radius: 8px !important;
}

.tech-alert .mud-alert-icon {
    color: #ef4444 !important;
}

/* Brand Icon Animation */
@keyframes shield-pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.tech-brand-icon {
    color: var(--tech-primary);
    border-radius: 50%;
    padding: 12px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    animation: shield-pulse 3s infinite;
}

/* Preloader Specifics */
.tech-loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--tech-surface-border);
    border-radius: 50%;
    border-top-color: var(--tech-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility */
.tech-text-glow {
    text-shadow: 0 0 10px var(--tech-primary-glow);
}

.tech-divider {
    background-color: var(--tech-surface-border) !important;
}

/* Legacy Overrides for MudBlazor specifics inside container */
.neumorphic-page-container {
    background: transparent !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix text overflow in divider sections */
.tech-divider-text {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 16px;
    font-weight: 500;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

/* Small loader for buttons */
.tech-loader-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--tech-surface-border);
    border-radius: 50%;
    border-top-color: #0f172a; /* Dark for inside primary button */
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--tech-bg); 
}
::-webkit-scrollbar-thumb {
    background: var(--tech-surface-border); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--tech-text-muted); 
}
