﻿/* =====================================================
SafeHouse Admin Global Theme System - SCROLLING FIXED
File: wwwroot/css/safehouse-theme.css
Purpose: Global theme with proper scrolling support
===================================================== */

:root {
    /* ===== SAFEHOUSE COLOR PALETTE ===== */
    --sh-primary-orange: #FF8C00;
    --sh-secondary-orange: #D2691E;
    --sh-dark-orange: #FF6B35;
    --sh-orange-light: #FFB347;
    --sh-orange-gradient: linear-gradient(135deg, #FF8C00 0%, #D2691E 100%);
    /* Dark Theme Colors */
    --sh-page-bg: #000000;
    --sh-page-bg-secondary: #0D0D0D;
    --sh-card-bg: #1A1A1A;
    --sh-card-bg-elevated: #242424;
    --sh-card-bg-secondary: #2D2D2D;
    --sh-border-color: #333333;
    --sh-border-light: #404040;
    /* Text Colors */
    --sh-text-primary: #FFFFFF;
    --sh-text-secondary: #CCCCCC;
    --sh-text-tertiary: #999999;
    --sh-text-muted: #666666;
    --sh-text-placeholder: #888888;
    /* Status Colors */
    --sh-success: #4CAF50;
    --sh-error: #DC143C;
    --sh-warning: #F39C12;
    --sh-info: #2196F3;
    /* Shadows */
    --sh-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --sh-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --sh-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    /* Border Radius */
    --sh-radius-sm: 8px;
    --sh-radius-md: 12px;
    --sh-radius-lg: 20px;
    /* Spacing */
    --sh-space-xs: 0.25rem;
    --sh-space-sm: 0.5rem;
    --sh-space-md: 1rem;
    --sh-space-lg: 1.5rem;
    --sh-space-xl: 2rem;
    /* Typography */
    --sh-font-size-sm: 0.875rem;
    --sh-font-size-base: 1rem;
    --sh-font-size-lg: 1.125rem;
    --sh-font-size-xl: 1.25rem;
    --sh-font-size-2xl: 1.5rem;
    --sh-font-size-3xl: 2rem;
    /* Transitions */
    --sh-transition-normal: 0.3s ease;
}

/* ===== CRITICAL SCROLLING FIX ===== */
/* REMOVED the problematic overflow: hidden from html/body */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--sh-page-bg);
    color: var(--sh-text-primary);
    /* FIXED: Allow normal scrolling behavior */
    overflow-x: hidden; /* Prevent horizontal scroll only */
    overflow-y: auto; /* Allow vertical scroll */
}

/* ===== LAYOUT COMPONENTS ===== */

.sh-main-layout {
    display: flex;
    min-height: 100vh;
    background: var(--sh-page-bg);
}

.sh-main-sidebar {
    flex-shrink: 0;
    width: 280px;
    background: var(--sh-card-bg);
    border-right: 1px solid var(--sh-border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sh-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--sh-page-bg-secondary);
}

.sh-main-topbar {
    flex-shrink: 0;
    height: 70px;
    background: var(--sh-card-bg);
    border-bottom: 1px solid var(--sh-border-color);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* CRITICAL: Content body that allows natural scrolling */
.sh-main-body {
    flex: 1;
    /* REMOVED: All overflow and height constraints */
    /* This allows the page to scroll naturally */
    background: var(--sh-page-bg-secondary);
    padding: 0;
    margin: 0;
}

/* ===== PAGE CONTAINERS ===== */

.sh-page-container {
    width: 100%;
    padding: var(--sh-space-xl);
    margin: 0;
    min-height: calc(100vh - 70px);
    background: var(--sh-page-bg-secondary);
}

.sh-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sh-space-xl);
    padding-bottom: var(--sh-space-lg);
    border-bottom: 1px solid var(--sh-border-color);
    flex-wrap: wrap;
    gap: var(--sh-space-lg);
}

.sh-page-title h1.sh-title {
    font-size: var(--sh-font-size-3xl);
    font-weight: 700;
    color: var(--sh-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
}

.sh-page-title .sh-subtitle {
    font-size: var(--sh-font-size-base);
    color: var(--sh-text-secondary);
    margin: var(--sh-space-sm) 0 0 0;
}

.sh-page-actions {
    display: flex;
    gap: var(--sh-space-md);
    align-items: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.sh-btn, .sh-btn-primary, .sh-btn-secondary, .sh-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: var(--sh-space-sm);
    padding: var(--sh-space-md) var(--sh-space-lg);
    border-radius: var(--sh-radius-md);
    font-size: var(--sh-font-size-sm);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--sh-transition-normal);
    white-space: nowrap;
}

.sh-btn-primary {
    background: var(--sh-orange-gradient);
    color: var(--sh-text-primary);
    box-shadow: var(--sh-shadow-sm);
}

    .sh-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: var(--sh-shadow-md);
    }

.sh-btn-secondary {
    background: var(--sh-card-bg-secondary);
    color: var(--sh-text-secondary);
    border: 1px solid var(--sh-border-light);
}

    .sh-btn-secondary:hover {
        background: var(--sh-border-light);
        color: var(--sh-text-primary);
    }

.sh-btn-outline {
    background: transparent;
    color: var(--sh-primary-orange);
    border: 2px solid var(--sh-primary-orange);
}

    .sh-btn-outline:hover {
        background: var(--sh-primary-orange);
        color: var(--sh-text-primary);
    }

.sh-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--sh-radius-md);
    background: var(--sh-card-bg-secondary);
    border: 1px solid var(--sh-border-color);
    color: var(--sh-text-secondary);
    cursor: pointer;
    transition: all var(--sh-transition-normal);
    margin-right: var(--sh-space-md);
}

    .sh-back-btn:hover {
        background: var(--sh-primary-orange);
        color: var(--sh-text-primary);
        border-color: var(--sh-primary-orange);
    }

/* ===== CARDS ===== */
.sh-card {
    background: var(--sh-card-bg);
    border: 1px solid var(--sh-border-color);
    border-radius: var(--sh-radius-lg);
    padding: var(--sh-space-lg);
    box-shadow: var(--sh-shadow-sm);
    transition: all var(--sh-transition-normal);
    margin-bottom: var(--sh-space-lg);
}

    .sh-card:hover {
        box-shadow: var(--sh-shadow-md);
        transform: translateY(-1px);
    }

/* ===== FORMS ===== */
.sh-form-container {
    background: var(--sh-card-bg);
    border: 1px solid var(--sh-border-color);
    border-radius: var(--sh-radius-lg);
    padding: var(--sh-space-xl);
    box-shadow: var(--sh-shadow-sm);
}

.sh-form-group {
    margin-bottom: var(--sh-space-lg);
}

.sh-form-label {
    display: block;
    margin-bottom: var(--sh-space-sm);
    color: var(--sh-text-secondary);
    font-weight: 500;
    font-size: var(--sh-font-size-sm);
}

.sh-form-input, .sh-select {
    width: 100%;
    padding: var(--sh-space-md);
    background: var(--sh-card-bg-secondary);
    border: 1px solid var(--sh-border-color);
    border-radius: var(--sh-radius-md);
    color: var(--sh-text-primary);
    font-size: var(--sh-font-size-base);
    transition: all var(--sh-transition-normal);
    min-height: 50px;
}

    .sh-form-input:focus, .sh-select:focus {
        outline: none;
        border-color: var(--sh-primary-orange);
        box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
        background: var(--sh-card-bg);
    }

    .sh-form-input::placeholder {
        color: var(--sh-text-placeholder);
    }

/* ===== STATISTICS SECTION ===== */
.sh-stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sh-space-lg);
    margin-bottom: var(--sh-space-xl);
}

.sh-stat-card {
    background: var(--sh-card-bg);
    border: 1px solid var(--sh-border-color);
    border-radius: var(--sh-radius-lg);
    padding: var(--sh-space-lg);
    display: flex;
    align-items: center;
    gap: var(--sh-space-lg);
    transition: all var(--sh-transition-normal);
    position: relative;
    overflow: hidden;
}

    .sh-stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--sh-primary-orange);
    }

.sh-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--sh-radius-lg);
    background: var(--sh-orange-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--sh-text-primary);
    flex-shrink: 0;
}

.sh-stat-content {
    flex: 1;
}

.sh-stat-number {
    font-size: var(--sh-font-size-3xl);
    font-weight: 700;
    color: var(--sh-text-primary);
    margin-bottom: var(--sh-space-xs);
}

.sh-stat-label {
    font-size: var(--sh-font-size-base);
    color: var(--sh-text-secondary);
    font-weight: 500;
}

/* ===== FILTERS SECTION ===== */
.sh-filters-section {
    background: var(--sh-card-bg);
    border: 1px solid var(--sh-border-color);
    border-radius: var(--sh-radius-lg);
    padding: var(--sh-space-lg);
    margin-bottom: var(--sh-space-xl);
}

.sh-search-bar {
    margin-bottom: var(--sh-space-lg);
}

.sh-search-input {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--sh-card-bg-secondary);
    border: 1px solid var(--sh-border-color);
    border-radius: var(--sh-radius-md);
    padding: var(--sh-space-md);
    transition: all var(--sh-transition-normal);
}

    .sh-search-input:focus-within {
        border-color: var(--sh-primary-orange);
        box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    }

    .sh-search-input i {
        color: var(--sh-text-muted);
        margin-right: var(--sh-space-md);
    }

    .sh-search-input input {
        flex: 1;
        background: transparent;
        border: none;
        color: var(--sh-text-primary);
        font-size: var(--sh-font-size-base);
        outline: none;
    }

        .sh-search-input input::placeholder {
            color: var(--sh-text-placeholder);
        }

.sh-filter-controls {
    display: flex;
    gap: var(--sh-space-md);
    align-items: center;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sh-main-layout {
        flex-direction: column;
    }

    .sh-main-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        order: 2;
    }

    .sh-main-content {
        order: 1;
    }

    .sh-page-container {
        padding: var(--sh-space-lg);
    }

    .sh-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .sh-stats-section {
        grid-template-columns: 1fr;
    }

    .sh-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== SCROLLBAR STYLING ===== */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--sh-border-color);
    border-radius: 4px;
}

    *::-webkit-scrollbar-thumb:hover {
        background: var(--sh-primary-orange);
    }

/* ===== UTILITY CLASSES ===== */
.sh-text-primary {
    color: var(--sh-text-primary);
}

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

.sh-text-muted {
    color: var(--sh-text-muted);
}

.sh-text-orange {
    color: var(--sh-primary-orange);
}

.sh-text-success {
    color: var(--sh-success);
}

.sh-text-error {
    color: var(--sh-error);
}

.sh-text-warning {
    color: var(--sh-warning);
}

.sh-bg-card {
    background-color: var(--sh-card-bg);
}

.sh-rounded-md {
    border-radius: var(--sh-radius-md);
}

.sh-rounded-lg {
    border-radius: var(--sh-radius-lg);
}

.sh-shadow-sm {
    box-shadow: var(--sh-shadow-sm);
}

.sh-shadow-md {
    box-shadow: var(--sh-shadow-md);
}

.sh-hover-lift {
    transition: transform var(--sh-transition-normal);
}

    .sh-hover-lift:hover {
        transform: translateY(-2px);
    }

.sh-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
