/* 
 * OnScene360 Admin CSS - Premium Glassmorphism Interface
 */

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

:root {
    --bg-dark: #0f0f12;
    --card-bg: rgba(26, 26, 36, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    
    --primary: #be0e2c;      /* OnScene360 Crimson */
    --primary-glow: rgba(190, 14, 44, 0.4);
    --accent: #e53251;       /* Light Crimson */
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(190, 14, 44, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(229, 50, 81, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 15, 20, 0.7);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--card-border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon-wrapper {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: white;
}

.brand-subtitle {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    padding: 0 1rem;
    margin-top: 1rem;
    flex: 1;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
}

.menu-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform var(--transition-speed);
}

.menu-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.menu-link.active {
    color: white;
    background: rgba(190, 14, 44, 0.15);
    border-color: rgba(190, 14, 44, 0.3);
    box-shadow: 0 0 15px rgba(190, 14, 44, 0.1);
}

.menu-link.active svg {
    stroke: var(--accent);
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.page-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.system-status {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: border-color var(--transition-speed), transform var(--transition-speed);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-top: 0.5rem;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border: 1px solid var(--card-border);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

/* Secondary statistics visualizer */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Charts & Trends */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.progress-list {
    margin-top: 1rem;
}

.progress-item {
    margin-bottom: 1.25rem;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.progress-label-name {
    font-weight: 500;
    color: white;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    box-shadow: 0 0 8px var(--primary);
}

/* Custom Table View */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}

.custom-table td {
    padding: 1.1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.custom-table tbody tr {
    transition: background-color var(--transition-speed);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--accent);
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-icon {
    padding: 0.4rem;
    border-radius: 8px;
}

/* Filter Controls Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-input-group {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.filter-input-group svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    color: white;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(190, 14, 44, 0.15);
}

.filter-input-group .form-control {
    padding-left: 2.5rem;
}

.select-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-control option {
    background-color: #1a1a24;
    color: white;
}

/* Pagination */
.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-links {
    display: flex;
    gap: 0.25rem;
}

.pagination-links .page-item {
    display: inline-block;
}

.pagination-links .page-link {
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.pagination-links .page-link:hover {
    background: rgba(255, 255, 255, 0.07);
}

.pagination-links .active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Detailed Report Layout */
.report-details-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 2rem;
    align-items: start;
}

.details-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-section-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.data-label {
    color: var(--text-secondary);
}

.data-value {
    color: white;
    font-weight: 500;
    text-align: right;
    max-width: 65%;
    word-break: break-word;
}

/* Maps Visualizer Widget */
.map-placeholder {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #1e1e2d;
    border: 1px solid var(--card-border);
}

.map-visual {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.65;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 15, 20, 0.4);
    text-align: center;
    padding: 1rem;
}

.map-overlay svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
    filter: drop-shadow(0 2px 8px var(--primary-glow));
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

.map-address {
    font-size: 0.8rem;
    color: white;
    font-weight: 500;
}

/* Photo Gallery & Lightbox */
.evidence-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.evidence-thumb-container {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
    cursor: pointer;
}

.evidence-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.evidence-thumb-container:hover .evidence-thumb {
    transform: scale(1.08);
}

.evidence-label-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    padding: 0.35rem;
    font-size: 0.65rem;
    text-align: center;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal lightbox style */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--card-border);
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Animations */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Alert Message */
.alert {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* Utility classes */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Responsive adjustments */
@media(max-width: 1024px) {
    .report-details-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none; /* In production, we would add a toggle burger menu */
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Login Page Specific Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(190, 14, 44, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(229, 50, 81, 0.1) 0%, transparent 50%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 24px;
    background: rgba(26, 26, 36, 0.45);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.login-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    margin: 0 auto 1.25rem auto;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: white;
}

.login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-icon-group {
    position: relative;
}

.input-icon-group svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    transition: color var(--transition-speed);
}

.input-icon-group .form-control {
    padding-left: 2.75rem;
}

.input-icon-group .form-control:focus + svg {
    color: var(--accent);
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
    border-radius: 12px;
    font-size: 1rem;
    margin-top: 1rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

