﻿/* ========================================
    PREVTECH - Complete Styles
    READ-ONLY EXPORT - React app untouched
    ======================================== */

/* ========================================
   CUSTOM SCROLLBAR - APP-WIDE STYLING
   ======================================== */

/* Webkit browsers (Chrome, Safari, Edge, Opera) */
*::-webkit-scrollbar {
    width: 6px !important; /* THIN: Vertical scrollbar - !important for Edge */
    height: 6px !important; /* THIN: Horizontal scrollbar - !important for Edge */
}

*::-webkit-scrollbar-track {
    background: transparent !important; /* Force transparent track for Edge */
    border-radius: 3px;
    box-shadow: none !important; /* Remove any default shadow */
}

*::-webkit-scrollbar-track-piece {
    background: transparent !important; /* Additional Edge override */
}

*::-webkit-scrollbar-thumb {
    background: rgba(150, 150, 150, 0) !important; /* Initially invisible */
    border-radius: 3px;
    transition: background 0.3s ease;
    border: none !important; /* Remove any default border */
}

/* Show thumb on hover over scrollable area */
*:hover::-webkit-scrollbar-thumb {
    background: rgba(150, 150, 150, 0.4) !important; /* Visible grey when hovering */
}

/* Make thumb more visible when actively scrolling/hovering the thumb itself */
*::-webkit-scrollbar-thumb:hover {
    background: rgba(150, 150, 150, 0.6) !important; /* Darker grey when directly hovering */
}

/* Additional Edge-specific overrides */
*::-webkit-scrollbar-button {
    display: none !important; /* Hide scroll buttons */
}

*::-webkit-scrollbar-corner {
    background: transparent !important; /* Transparent corner */
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin; /* THIN scrollbar for Firefox */
    scrollbar-color: rgba(150, 150, 150, 0.4) transparent; /* thumb / track */
}
        
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #ffffff;
}
        
/* CRITICAL: Spacing preserved from Tailwind */
/* space-y-5 = 20px gap */
/* space-y-2 = 8px gap */
/* mb-6 = 24px margin-bottom */
/* mt-8 = 32px margin-top */
/* gap-4 = 16px gap */
        
/* Screen Management */
.screen { display: none; }
.screen.active { display: block; }
        
/* ========================================
    LOGIN SCREEN
    ======================================== */
        
.login-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0 24px; /* px-6 */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    overflow: hidden;
}
        
.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
        
.login-bg-1 {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(127, 29, 29, 0.2) 0%, transparent 70%);
    filter: blur(80px);
    animation: pulse-anim 4s ease-in-out infinite;
}
        
.login-bg-2 {
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(153, 27, 27, 0.2) 0%, transparent 70%);
    filter: blur(80px);
    animation: pulse-anim 4s ease-in-out infinite;
    animation-delay: 2s;
}
        
@keyframes pulse-anim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
        
.arrow-decoration {
    position: absolute;
    width: auto;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
}
        
.arrow-left { left: 0; top: 0; height: 384px; }
.arrow-right { right: 0; bottom: 0; height: 384px; }
        
.login-content {
    width: 100%;
    max-width: 448px; /* max-w-sm */
    position: relative;
    z-index: 10;
}
        
.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px; /* mb-6 - CRITICAL SPACING */
}
        
.logo-container {
    position: relative;
    margin-bottom: 24px; /* mb-6 - CRITICAL SPACING */
}
        
.logo {
    height: 112px; /* h-28 */
    width: auto;
    filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
}
        
/* LOGIN FORM - CRITICAL SPACING */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px; /* space-y-5 - CRITICAL: 20px between fields */
}
        
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px; /* space-y-2 - CRITICAL: 8px label to input */
    width: 100%; /* ADDED: Ensure field respects parent width */
    max-width: 100%; /* ADDED: Prevent overflow */
}
        
.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px; /* text-lg */
    font-weight: 500;
}
        
.input-wrapper {
    position: relative;
    width: 100%; /* ADDED: Ensure wrapper respects parent width */
    max-width: 100%; /* ADDED: Prevent overflow */
}
        
.input-icon {
    position: absolute;
    left: 16px; /* left-4 */
    top: 50%;
    transform: translateY(-50%);
    width: 20px; /* size-5 */
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none; /* ADDED: Prevent icon from blocking input clicks */
}
        
.form-input {
    width: 100%;
    max-width: 100%; /* ADDED: Prevent overflow */
    height: 56px; /* h-14 */
    padding-left: 48px; /* pl-12 */
    padding-right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px; /* rounded-2xl */
    color: #ffffff;
    font-size: 18px; /* INCREASED from 16px */
    transition: all 0.3s;
    box-sizing: border-box; /* ADDED: Ensure padding is included in width calculation */
}
        
.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px; /* INCREASED from default to match input */
}
        
.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(248, 113, 113, 0.5);
}
        
.btn-login {
    width: 100%;
    height: 56px; /* h-14 */
    background: linear-gradient(to right, rgba(153, 27, 27, 0.9), rgba(69, 10, 10, 0.9));
    color: #ffffff;
    font-size: 20px; /* INCREASED from 16px */
    font-weight: 600;
    border: none;
    border-radius: 16px; /* rounded-2xl */
    margin-top: 32px; /* mt-8 - CRITICAL SPACING */
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 15px -3px rgba(69, 10, 10, 0.2);
}
        
.btn-login:hover {
    background: linear-gradient(to right, rgba(185, 28, 28, 0.9), rgba(127, 29, 29, 0.9));
}
        
.status-bar {
    margin-top: 32px; /* mt-8 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* gap-2 */
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px; /* text-xs */
}
        
.status-dot {
    width: 8px; /* size-2 */
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
        
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
        
/* ========================================
    ALERTS SCREEN
    ======================================== */
        
.alerts-screen {
    height: 100vh;
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
        
/* Header - REDUCED HEIGHT */
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px; /* REDUCED from 20px to 12px vertical padding */
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0; /* REMOVED margin-bottom */
    position: relative;
}
        
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px; /* gap-3 */
}
        
.header-logo img {
    height: 36px; /* h-9 */
    width: auto;
}
        
.header-title {
    font-size: 20px;
    font-weight: 600;
}
        
.btn-icon {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s;
}
        
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
        
.btn-icon svg {
    width: 28px; /* INCREASED from 24px */
    height: 28px; /* INCREASED from 24px */
}
        
/* Stats Grid - CRITICAL SPACING */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px; /* gap-3 - CRITICAL: 12px between stat cards */
    margin-top: 16px;
}
        
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px; /* p-4 */
    transition: all 0.3s;
}
        
.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px; /* mb-2 */
}
        
.stat-value {
    font-size: 28px;
    font-weight: 700;
}
        
.stat-critical { color: #ef4444; }
.stat-warning { color: #f59e0b; }
.stat-success { color: #10b981; }
        
/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px; /* p-5 */
}
        
/* Alerts List - CRITICAL SPACING */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 16px; /* gap-4 - CRITICAL: 16px between alert cards */
}
        
/* Alert Card */
.alert-card {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    border: 1px solid;
    border-radius: 24px; /* rounded-3xl */
    transition: all 0.3s;
}
        
.alert-card-critical {
    border-color: rgba(239, 68, 68, 0.15);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.01), rgba(234, 88, 12, 0.01));
}
        
.alert-card-warning {
    border-color: rgba(245, 158, 11, 0.15);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.01), rgba(234, 179, 8, 0.01));
}
        
.alert-card-success {
    border-color: rgba(16, 185, 129, 0.15);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.01), rgba(34, 197, 94, 0.01));
}
        
.alert-glow {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}
        
.alert-glow-critical { background: rgba(239, 68, 68, 0.05); }
.alert-glow-warning { background: rgba(245, 158, 11, 0.05); }
.alert-glow-success { background: rgba(16, 185, 129, 0.05); }
        
.alert-header {
    padding: 16px 20px; /* p-4 sm:p-5 */
    cursor: pointer;
}
        
.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 12px; /* gap-3 - CRITICAL */
}
        
.alert-icon {
    background: rgba(239, 68, 68, 0.2);
    border-radius: 16px; /* rounded-2xl */
    padding: 12px; /* p-3 */
    flex-shrink: 0;
}
        
.alert-icon-critical { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.alert-icon-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.alert-icon-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
        
.alert-icon svg {
    width: 24px;
    height: 24px;
}
        
.alert-info {
    flex: 1;
    min-width: 0;
}
        
.alert-title-row {
    display: flex;
    align-items: center;
    gap: 8px; /* gap-2 */
    margin-bottom: 4px; /* mb-1 */
    flex-wrap: wrap;
}
        
.alert-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}
        
.alert-badge {
    padding: 2px 8px; /* py-0.5 px-2 */
    border: 1px solid;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}
        
.alert-badge-critical {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}
        
.alert-badge-warning {
    background: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.4);
}
        
.alert-badge-success {
    background: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}
        
.alert-device {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px; /* mb-2 */
}
        
.alert-meta {
    display: flex;
    align-items: center;
    gap: 8px; /* gap-2 */
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}
        
.alert-meta svg {
    width: 16px;
    height: 16px;
}
        
/* Responsive */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MAIN APP LAYOUT
   ======================================== */

.app-container {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
}

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   APP HEADER (with hamburger)
   ======================================== */

.header-logo-img {
    height: 36px;
    width: auto;
}

/* ========================================
   SIDE MENU
   ======================================== */

.side-menu {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.side-menu.side-menu-open {
    pointer-events: auto;
}

/* Overlay */
.side-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.side-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Menu Content */
.side-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.side-menu-content.active {
    transform: translateX(0);
}

/* Menu Header */
.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.side-menu-logo {
    height: 32px;
    width: auto;
}

/* User Info */
.side-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.8), rgba(69, 10, 10, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: #ffffff;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Menu Navigation */
.side-menu-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.menu-item.active {
    background: rgba(153, 27, 27, 0.2);
    color: #ffffff;
    border-left-color: rgba(153, 27, 27, 1);
}

.menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.menu-item span {
    font-size: 16px;
    font-weight: 500;
}

/* Menu Footer */
.side-menu-footer {
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item-logout {
    color: rgba(239, 68, 68, 0.9);
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.menu-item-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 1);
}

/* Responsive */
@media (max-width: 640px) {
    .side-menu-content {
        width: 100%;
        max-width: 320px;
    }
}

/* Header Top - NEW LAYOUT: Left (hamburger), Center (title), Right (shield logo) */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space items evenly */
    margin-bottom: 0px; /* mb-6 - CRITICAL */
    position: relative; /* For absolute positioning of centered title */
}

/* Centered Title */
.header-title-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px; /* Slightly larger for prominence */
    font-weight: 700; /* Bolder */
    color: #ffffff;
    white-space: nowrap;
}

/* Shield Logo (RIGHT) */
.header-shield-logo {
    height: 40px; /* Slightly larger than the hamburger icon */
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.header-shield-logo:hover {
    opacity: 1;
}

/* Keep hamburger button styling */
.btn-icon {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1; /* Ensure it's above the centered title */
}

/* Remove old header-logo styles (no longer needed) */
.header-logo {
    display: none; /* Hide the old logo container */
}