/* ==========================================================================
   EDGE UNIVERSAL THEME - Complete Application Styling
   ========================================================================== */

/* ==========================================================================
   1. EDGE BRAND COLOR VARIABLES & MOBILE VIEWPORT UNITS
   ========================================================================== */
:root {
    /* Edge Brand Colors */
    --color-primary: #2F66F4; /* Edge Blue */
    --color-primary-light: #60A5FA; /* Lighter blue */
    --color-primary-dark: #1E4ED8; /* Darker blue for hover */
    --color-secondary: #8C2FE2; /* Edge Purple */
    --color-secondary-light: #A855F7; /* Lighter purple */
    --color-secondary-dark: #7C2DD2; /* Darker purple for hover */
    
    /* Mobile viewport units (set by JavaScript) */
    --vh: 1vh;
    --vw: 1vw;
    
    /* Safe area insets for devices with notches */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    
    /* Background Colors */
    --color-background-dark: #070A23; /* Edge Dark Navy */
    --color-background: #0F172A; /* Dark slate background */
    --color-background-light: #1E293B; /* Lighter dark background */
    --color-surface: #1E293B; /* Dark cards */
    --color-surface-hover: #334155; /* Dark hover state */
    --color-surface-light: #334155; /* Lighter dark surface */
    
    /* Text Colors */
    --color-text-white: #FFFFFF; /* White text */
    --color-text-light: #FFFFFF; /* Pure white for dark backgrounds */
    --color-text-dark: #111827; /* Dark text for light backgrounds (Gray-900) */
    --color-text-medium: #E2E8F0; /* Light gray text */
    --color-text-muted: #CBD5E1; /* Muted light text */
    
    /* Status Colors */
    --color-success: #22C55E; /* Green */
    --color-warning: #F59E0B; /* Orange */
    --color-danger: #EF4444; /* Red */
    --color-info: #3B82F6; /* Info blue */
    
    /* Border Colors */
    --color-border: #334155; /* Dark border */
    --color-border-light: #475569; /* Lighter dark border */
    --color-border-dark: #1E293B; /* Darker border */
    
    /* Gradient Definitions */
    --gradient-primary: linear-gradient(135deg, #2F66F4 0%, #8C2FE2 100%);
    --gradient-primary-hover: linear-gradient(135deg, #1E4ED8 0%, #7C2DD2 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Font Family */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   2. GLOBAL STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background-dark);
    color: var(--color-text-white);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ==========================================================================
   3. LAYOUT COMPONENTS
   ========================================================================== */

/* Main Layout */
.main-layout-container {
    display: flex;
    height: 100vh;
    background-color: var(--color-background);
}

/* Sidebar */
.sidebar {
    background-color: var(--color-background-dark);
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    z-index: 40;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    height: 5rem;
    margin: 0 auto;
    max-width: 100%;
}

/* Navigation */
.sidebar-nav {
    flex-grow: 1;
    padding: 0 0.75rem;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: var(--radius-md);
    color: var(--color-text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-text-white);
}

.nav-link.active {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.nav-link .icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Content Area */
.content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--color-background);
}

/* Mobile Header - Updated for proper mobile styling */
.mobile-header {
    background-color: var(--color-primary);
    background: var(--color-primary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-primary-dark);
    box-shadow: var(--shadow-sm);
}

.mobile-header .logo {
    height: 3.5rem;
    filter: brightness(0) invert(1);
}

.menu-button {
    background: none;
    border: none;
    color: var(--color-text-white);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Mobile-specific menu button overrides */
@media (max-width: 767px) {
    .mobile-header .menu-button {
        color: white !important;
    }
    
    .mobile-header .menu-button svg {
        color: white !important;
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */

/* Primary Button */
.btn-primary, .edge-button {
    background: var(--gradient-primary);
    color: var(--color-text-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover, .edge-button:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active, .edge-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-border-dark);
}

/* Success Button */
.btn-success {
    background-color: var(--color-success);
    color: var(--color-text-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-success:hover {
    background-color: #16A34A;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-text-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Warning Button */
.btn-warning {
    background-color: var(--color-warning);
    color: var(--color-text-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-warning:hover {
    background-color: #D97706;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

/* ==========================================================================
   5. CARDS AND SURFACES
   ========================================================================== */

.card, .edge-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover, .edge-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-surface);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-surface-hover);
}

/* ==========================================================================
   6. FORMS
   ========================================================================== */

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    font-size: var(--font-size-sm);
}

/* Unified input/select styling for admin forms using class="form-input" */
.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background-color: #ffffff;
    color: var(--color-text-dark);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(47, 102, 244, 0.1);
}

.form-input::placeholder {
    color: #6B7280; /* Gray-500 */
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background-color: #ffffff;
    color: var(--color-text-dark);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(47, 102, 244, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

/* Select */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background-color: #ffffff;
    color: var(--color-text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(47, 102, 244, 0.1);
}

/* Ensure options in dropdowns are readable */
select.form-input option,
select.form-select option {
    background-color: #ffffff;
    color: var(--color-text-dark);
}

/* ==========================================================================
   7. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-dark);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem 0;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    color: var(--color-text-medium);
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-white { color: var(--color-text-white) !important; }
.text-light { color: var(--color-text-light) !important; }
.text-white { color: var(--color-text-white) !important; }

/* Page Title Styling */
.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
}

.page-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-muted);
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
}

/* ==========================================================================
   8. TABLES
   ========================================================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background-color: var(--color-surface-hover);
    color: var(--color-text-white);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-white) !important;
    font-size: var(--font-size-sm);
    background-color: var(--color-background-dark) !important;
}

.table tbody tr {
    background-color: var(--color-background-dark) !important;
}

.table tbody tr:hover {
    background-color: var(--color-primary-dark) !important;
}

.table tbody tr td {
    background-color: var(--color-background-dark) !important;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Force dark theme for all table elements */
.table tbody tr,
.table tbody tr td,
.table tbody tr th {
    background-color: var(--color-background-dark) !important;
    color: var(--color-text-white) !important;
}

.table tbody tr:hover,
.table tbody tr:hover td {
    background-color: var(--color-primary-dark) !important;
}

/* My Campaigns Page Styles */
.campaigns-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.campaign-card {
    background: linear-gradient(135deg, var(--color-background-dark) 0%, #1a1f3a 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(47, 102, 244, 0.1);
    border: 1px solid rgba(47, 102, 244, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.campaign-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.campaign-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(47, 102, 244, 0.2), 0 0 0 1px rgba(47, 102, 244, 0.3);
    border-color: rgba(47, 102, 244, 0.4);
}

.campaign-card:hover::before {
    opacity: 1;
}

.brand-tag {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 700;
    border-radius: 25px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(47, 102, 244, 0.3);
    word-break: break-word;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.brand-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.brand-tag:hover::before {
    left: 100%;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(47, 102, 244, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(47, 102, 244, 0.1);
}

.date-range svg {
    color: var(--color-primary);
    filter: drop-shadow(0 2px 4px rgba(47, 102, 244, 0.3));
}

.filters-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.filters-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Filter section text styling for light background */
.filters-section h3,
.filters-section label,
.filters-section .text-gray-800,
.filters-section .text-gray-700,
.filters-section .text-gray-900,
.filters-section .block,
.filters-section .text-sm,
.filters-section .font-medium,
.filters-section .font-semibold {
    color: #1f2937 !important;
}

.filters-section select,
.filters-section input {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}

.filters-section select:focus,
.filters-section input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(47, 102, 244, 0.1) !important;
}

/* Override any white text in filter sections */
.filters-section * {
    color: #1f2937 !important;
}

/* But keep button text white */
.filters-section button {
    color: #ffffff !important;
}

/* Specific overrides for Tailwind classes in filter sections */
.filters-section .text-gray-700,
.filters-section .text-gray-800,
.filters-section .text-gray-900,
.filters-section .text-gray-600,
.filters-section .text-gray-500,
.filters-section .text-sm,
.filters-section .text-lg,
.filters-section .text-xs,
.filters-section .font-medium,
.filters-section .font-semibold,
.filters-section .block {
    color: #1f2937 !important;
}

/* Override any global text color rules for filter sections */
.filters-section label,
.filters-section h3,
.filters-section p,
.filters-section span,
.filters-section div {
    color: #1f2937 !important;
}

/* Also target bg-gray-50 filter sections */
.bg-gray-50 label,
.bg-gray-50 h3,
.bg-gray-50 p,
.bg-gray-50 span,
.bg-gray-50 div,
.bg-gray-50 .text-gray-700,
.bg-gray-50 .text-gray-800,
.bg-gray-50 .text-gray-900,
.bg-gray-50 .text-gray-600,
.bg-gray-50 .text-gray-500,
.bg-gray-50 .text-sm,
.bg-gray-50 .text-lg,
.bg-gray-50 .text-xs,
.bg-gray-50 .font-medium,
.bg-gray-50 .font-semibold,
.bg-gray-50 .block {
    color: #1f2937 !important;
}

/* But keep button text white in bg-gray-50 sections */
.bg-gray-50 button {
    color: #ffffff !important;
}

/* Admin pages with light backgrounds need dark text */
.extracted-product-data-editor .text-gray-900,
.extracted-product-data-editor .text-gray-700,
.extracted-product-data-editor .text-gray-500,
.extracted-product-data-editor .text-gray-600,
.extracted-product-data-editor td,
.extracted-product-data-editor th,
.extracted-product-data-editor .text-sm,
.extracted-product-data-editor .text-xs,
.extracted-product-data-editor .font-medium,
.extracted-product-data-editor .font-semibold,
.extracted-product-data-editor label,
.extracted-product-data-editor p,
.extracted-product-data-editor span {
    color: #1f2937 !important;
}

.survey-answers-editor .text-gray-900,
.survey-answers-editor .text-gray-700,
.survey-answers-editor .text-gray-500,
.survey-answers-editor .text-gray-600,
.survey-answers-editor td,
.survey-answers-editor th,
.survey-answers-editor .text-sm,
.survey-answers-editor .text-xs,
.survey-answers-editor .font-medium,
.survey-answers-editor .font-semibold,
.survey-answers-editor label,
.survey-answers-editor p,
.survey-answers-editor span {
    color: #1f2937 !important;
}

/* But keep button text white in admin pages */
.extracted-product-data-editor button,
.survey-answers-editor button {
    color: #ffffff !important;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

.filter-input,
.filter-select {
    padding: 1rem 1.25rem;
    border: 1px solid rgba(47, 102, 244, 0.2);
    border-radius: 15px;
    background: rgba(47, 102, 244, 0.05);
    color: var(--color-text-white);
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(47, 102, 244, 0.2), 0 4px 20px rgba(47, 102, 244, 0.1);
    background: rgba(47, 102, 244, 0.1);
    transform: translateY(-2px);
}

.filter-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

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

.visit-item {
    background: linear-gradient(135deg, var(--color-background-dark) 0%, #1a1f3a 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 102, 244, 0.1);
    border: 1px solid rgba(47, 102, 244, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.visit-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.visit-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 30px rgba(47, 102, 244, 0.15), 0 0 0 1px rgba(47, 102, 244, 0.25);
    border-color: rgba(47, 102, 244, 0.3);
}

.visit-item:hover::before {
    opacity: 1;
}

.visit-item-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.visit-store-name {
    font-weight: 600;
    color: var(--color-text-white);
    font-size: var(--font-size-base);
    line-height: 1.3;
    margin: 0;
}

.visit-timestamp {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.3;
    margin: 0;
}

.visit-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.status-badge:hover::before {
    left: 100%;
}

.status-badge.in-progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.status-badge.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

.status-badge.images {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.status-badge.products {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.visit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.visit-actions .btn-primary-modern,
.visit-actions .btn-secondary-modern {
    flex: 1;
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--color-background-dark) 0%, #1a1f3a 100%);
    border-radius: 20px;
    border: 1px solid rgba(47, 102, 244, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.pagination::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(47, 102, 244, 0.3);
    border-radius: 15px;
    background: rgba(47, 102, 244, 0.1);
    color: var(--color-text-white);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.pagination-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(47, 102, 244, 0.3);
}

.pagination-btn:hover:not(:disabled)::before {
    left: 100%;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pagination-info {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.visits-container {
    background: linear-gradient(135deg, var(--color-background-dark) 0%, #1a1f3a 100%);
    border-radius: 20px;
    border: 1px solid rgba(47, 102, 244, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.visits-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.visits-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid rgba(47, 102, 244, 0.1);
}

.visits-content {
    padding: 2rem;
}

/* Responsive design for My Campaigns */
@media (min-width: 768px) {
    .campaigns-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .filter-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .campaigns-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .campaigns-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   9. BADGES AND STATUS
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.badge-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-white);
}

.badge-success {
    background-color: var(--color-success);
    color: var(--color-text-white);
}

.badge-warning {
    background-color: var(--color-warning);
    color: var(--color-text-white);
}

.badge-danger {
    background-color: var(--color-danger);
    color: var(--color-text-white);
}

.badge-light {
    background-color: var(--color-surface-hover);
    color: var(--color-text-dark);
}

/* ==========================================================================
   10. ALERTS AND NOTIFICATIONS
   ========================================================================== */

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.alert-primary {
    background-color: rgba(47, 102, 244, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: var(--color-success);
    color: #16A34A;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--color-warning);
    color: #D97706;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: #DC2626;
}

/* ==========================================================================
   11. LOADING AND SPINNERS
   ========================================================================== */

.spinner, .edge-spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(47, 102, 244, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   12. SPLASH SCREEN
   ========================================================================== */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-background-dark);
    z-index: 9999;
}

.splash-screen .main-logo {
    width: 250px;
    margin-bottom: 2rem;
}

.splash-screen p {
    font-size: 1.1rem;
    color: var(--color-text-white);
}

.splash-footer {
    position: absolute;
    bottom: 2rem;
    text-align: center;
}

.splash-footer p {
    font-size: 0.9rem;
    color: var(--color-text-white);
    opacity: 0.8;
}

.splash-footer .powered-by-logo {
    height: 30px;
    margin-top: 0.5rem;
}

/* ==========================================================================
   13. UTILITY CLASSES
   ========================================================================== */

/* Background Colors */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-secondary { background-color: var(--color-secondary) !important; }
.bg-success { background-color: var(--color-success) !important; }
.bg-warning { background-color: var(--color-warning) !important; }
.bg-danger { background-color: var(--color-danger) !important; }
.bg-light { background-color: var(--color-surface-hover) !important; }
.bg-dark { background-color: var(--color-background-dark) !important; }
.bg-white { background-color: var(--color-surface) !important; }

/* Text Colors */
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-white { color: var(--color-text-white) !important; }
.text-light { color: var(--color-text-light) !important; }
.text-white { color: var(--color-text-white) !important; }
.text-dark { color: var(--color-text-dark) !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

/* Flexbox */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }

/* ==========================================================================
   14. RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        z-index: 50;
        transition: left 0.3s ease-in-out;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .mobile-header {
        display: flex;
    }
}

@media (min-width: 769px) {
    .mobile-header {
        display: none;
    }
}

/* ==========================================================================
   15. ANIMATIONS
   ========================================================================== */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

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

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   16. EDGE SPECIFIC COMPONENTS
   ========================================================================== */

.edge-gradient {
    background: var(--gradient-primary);
}

.edge-text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.edge-navbar {
    background-color: var(--color-background-dark);
    color: var(--color-text-white);
}

/* ==========================================================================
   17. MOBILE TOUCH INTERACTIONS & ACCESSIBILITY
   ========================================================================== */

/* Mobile-first touch target sizing - minimum 44px for accessibility */
@media (max-width: 768px) {
    /* Ensure all buttons meet minimum touch target size */
    .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning,
    .edge-button, button, .button, [role="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.5rem;
        touch-action: manipulation; /* Prevent double-tap zoom */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Custom tap highlight */
    }
    
    /* Small buttons still need minimum touch targets */
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.625rem 1.25rem;
    }
    
    /* Form inputs optimized for mobile */
    .form-input, .form-control, .form-select, input, select, textarea {
        min-height: 44px;
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
        touch-action: manipulation;
    }
    
    /* Mobile-optimized table interactions */
    .table td, .table th {
        padding: 1rem 0.75rem;
        min-height: 44px;
    }
    
    /* Touch-friendly navigation links */
    .nav-link, a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        touch-action: manipulation;
    }
    
    /* File upload areas need larger touch targets */
    .file-drop-zone {
        min-height: 120px;
        padding: 2rem 1rem;
        touch-action: manipulation;
    }
    
    /* Action buttons in cards/lists */
    .file-action-btn, .action-btn, .icon-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
        touch-action: manipulation;
    }
}

/* Enhanced touch feedback for all interactive elements */
@media (max-width: 768px) {
    /* Improved touch feedback with subtle animations */
    button, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning,
    .edge-button, [role="button"], .clickable {
        transition: all 0.15s ease-out;
        position: relative;
        overflow: hidden;
    }
    
    /* Active state feedback for touch */
    button:active, .btn-primary:active, .btn-secondary:active, 
    .btn-success:active, .btn-danger:active, .btn-warning:active,
    .edge-button:active, [role="button"]:active {
        transform: scale(0.98);
        transition: transform 0.1s ease-out;
    }
    
    /* Touch ripple effect */
    button::before, .btn-primary::before, .btn-secondary::before,
    .btn-success::before, .btn-danger::before, .btn-warning::before,
    .edge-button::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease;
        pointer-events: none;
    }
    
    button:active::before, .btn-primary:active::before, .btn-secondary:active::before,
    .btn-success:active::before, .btn-danger:active::before, .btn-warning:active::before,
    .edge-button:active::before {
        width: 100px;
        height: 100px;
    }
}

/* Prevent text selection on touch interactions */
@media (max-width: 768px) {
    button, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning,
    .edge-button, [role="button"], .clickable, .file-action-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Enhanced focus indicators for keyboard navigation on mobile */
@media (max-width: 768px) {
    button:focus, .btn-primary:focus, .btn-secondary:focus,
    .btn-success:focus, .btn-danger:focus, .btn-warning:focus,
    .edge-button:focus, [role="button"]:focus,
    .form-input:focus, .form-control:focus, .form-select:focus,
    input:focus, select:focus, textarea:focus {
        outline: 3px solid var(--color-primary);
        outline-offset: 2px;
        box-shadow: 0 0 0 3px rgba(47, 102, 244, 0.2);
    }
}

/* Mobile-specific spacing and layout improvements */
@media (max-width: 768px) {
    /* Increase spacing between interactive elements */
    .btn-primary + .btn-primary,
    .btn-primary + .btn-secondary,
    .btn-secondary + .btn-primary,
    .btn-secondary + .btn-secondary,
    button + button {
        margin-left: 0.75rem;
        margin-top: 0.5rem;
    }
    
    /* Stack buttons vertically on very small screens */
    @media (max-width: 480px) {
        .btn-primary + .btn-primary,
        .btn-primary + .btn-secondary,
        .btn-secondary + .btn-primary,
        .btn-secondary + .btn-secondary,
        button + button {
            margin-left: 0;
            margin-top: 0.75rem;
        }
        
        /* Full-width buttons on small screens when appropriate */
        .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning {
            width: 100%;
            justify-content: center;
        }
    }
}

/* Improved scrolling and momentum on mobile */
@media (max-width: 768px) {
    .main-content, .card-body, .table-container, .scrollable {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Prevent horizontal scroll issues */
    body, html {
        overflow-x: hidden;
    }
}

/* Mobile-optimized table interactions */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
    
    .table td, .table th {
        padding: 0.875rem 0.5rem;
        vertical-align: middle;
    }
    
    /* Make table rows more touch-friendly */
    .table tbody tr {
        cursor: pointer;
        transition: background-color 0.15s ease;
    }
    
    .table tbody tr:active {
        background-color: rgba(47, 102, 244, 0.1) !important;
    }
}

/* Enhanced mobile form interactions */
@media (max-width: 768px) {
    /* Larger form elements for easier interaction */
    .form-group {
        margin-bottom: 1.75rem;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }
    
    /* Better checkbox and radio button sizing */
    input[type="checkbox"], input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
        margin-right: 0.75rem;
    }
    
    /* File input improvements */
    input[type="file"] {
        padding: 1rem;
        border: 2px dashed var(--color-border);
        border-radius: var(--radius-lg);
        background: var(--color-background-light);
    }
}

/* Mobile-specific loading and feedback states */
@media (max-width: 768px) {
    /* Enhanced loading states */
    .loading, [disabled] {
        opacity: 0.7;
        cursor: not-allowed;
        pointer-events: none;
    }
    
    /* Better visual feedback for form validation */
    .form-input:invalid, .form-control:invalid {
        border-color: var(--color-danger);
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    }
    
    .form-input:valid, .form-control:valid {
        border-color: var(--color-success);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
    }
}

/* Orientation-specific adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    /* Adjust spacing in landscape mode */
    .main-content {
        padding: 1rem;
    }
    
    /* Smaller buttons in landscape to save space */
    .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* High DPI display optimizations */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    /* Sharper borders and shadows on high DPI displays */
    button, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning,
    .form-input, .form-control, .card {
        border-width: 0.5px;
    }
}

/* ==========================================================================
   18. COMPREHENSIVE MOBILE LAYOUT IMPROVEMENTS
   ========================================================================== */

/* Mobile viewport and scaling optimizations */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Ensure proper box-sizing for all elements */
    *, *::before, *::after {
        box-sizing: border-box;
    }
    
    /* Main content container adjustments */
    .main-content {
        padding: 1rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Page titles and headers */
    .page-title {
        font-size: 1.875rem; /* Smaller on mobile */
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Mobile-specific spacing and typography */
@media (max-width: 768px) {
    /* Consistent spacing system */
    h1 { font-size: 1.875rem; margin-bottom: 1rem; }
    h2 { font-size: 1.5rem; margin-bottom: 0.875rem; }
    h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
    h4 { font-size: 1.125rem; margin-bottom: 0.625rem; }
    h5 { font-size: 1rem; margin-bottom: 0.5rem; }
    h6 { font-size: 0.875rem; margin-bottom: 0.5rem; }
    
    /* Paragraph and text spacing */
    p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    /* List improvements */
    ul, ol {
        padding-left: 1.25rem;
        margin-bottom: 1rem;
    }
    
    li {
        margin-bottom: 0.25rem;
        line-height: 1.4;
    }
}

/* Mobile card and surface improvements */
@media (max-width: 768px) {
    .card, .edge-card {
        margin: 0.5rem 0;
        border-radius: 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-header {
        padding: 1rem;
        border-radius: 0.75rem 0.75rem 0 0;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 0.75rem 1rem;
        border-radius: 0 0 0.75rem 0.75rem;
    }
    
    /* Ensure cards don't overflow */
    .card, .edge-card {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
}

/* Mobile navigation and sidebar improvements */
@media (max-width: 768px) {
    /* Sidebar adjustments */
    .sidebar {
        width: 280px; /* Slightly wider for better touch targets */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Navigation links */
    .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        margin: 0.125rem 0.5rem;
    }
    
    /* Mobile header improvements */
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 100;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Mobile form layout improvements */
@media (max-width: 768px) {
    /* Form containers */
    .form-container, .modal-body {
        padding: 1rem;
    }
    
    /* Form groups and spacing */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    /* Form labels */
    .form-label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--color-text-dark);
    }
    
    /* Input groups and button combinations */
    .input-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .input-group .form-input {
        border-radius: 0.5rem;
    }
    
    .input-group .btn-primary,
    .input-group .btn-secondary {
        border-radius: 0.5rem;
        width: 100%;
    }
}

/* Mobile table improvements */
@media (max-width: 768px) {
    /* Responsive table wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .table {
        min-width: 600px; /* Minimum width to prevent cramping */
        font-size: 0.75rem;
    }
    
    .table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
    }
    
    /* Mobile table alternative - card layout */
    .table-mobile-cards {
        display: none;
    }
    
    @media (max-width: 480px) {
        .table-responsive {
            display: none;
        }
        
        .table-mobile-cards {
            display: block;
        }
        
        .table-mobile-card {
            background: white;
            border-radius: 0.5rem;
            padding: 1rem;
            margin-bottom: 0.75rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--color-border);
        }
        
        .table-mobile-card-header {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--color-primary);
        }
        
        .table-mobile-card-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.25rem 0;
            border-bottom: 1px solid #f3f4f6;
        }
        
        .table-mobile-card-row:last-child {
            border-bottom: none;
        }
        
        .table-mobile-card-label {
            font-weight: 500;
            color: var(--color-text-dark);
            font-size: 0.75rem;
        }
        
        .table-mobile-card-value {
            font-size: 0.75rem;
            color: var(--color-text-medium);
        }
    }
}

/* Mobile modal and popup improvements */
@media (max-width: 768px) {
    /* Modal adjustments */
    .modal {
        padding: 1rem;
    }
    
    .modal-dialog {
        width: 100%;
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }
    
    .modal-content {
        border-radius: 1rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 12rem);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 1rem;
        border-top: 1px solid var(--color-border);
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
        order: 1;
    }
    
    .modal-footer .btn-secondary {
        order: 2;
    }
}

/* Mobile grid and layout improvements */
@media (max-width: 768px) {
    /* Grid systems */
    .grid, .grid-cols-1, .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        display: grid;
        gap: 1rem;
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    @media (max-width: 480px) {
        .grid-cols-2 {
            grid-template-columns: 1fr;
        }
    }
    
    /* Flex layouts */
    .flex {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .flex-col {
        flex-direction: column;
    }
    
    .flex-row {
        flex-direction: row;
    }
    
    /* Spacing utilities */
    .space-y-1 > * + * { margin-top: 0.25rem; }
    .space-y-2 > * + * { margin-top: 0.5rem; }
    .space-y-3 > * + * { margin-top: 0.75rem; }
    .space-y-4 > * + * { margin-top: 1rem; }
    
    .space-x-1 > * + * { margin-left: 0.25rem; }
    .space-x-2 > * + * { margin-left: 0.5rem; }
    .space-x-3 > * + * { margin-left: 0.75rem; }
    .space-x-4 > * + * { margin-left: 1rem; }
}

/* Mobile image and media improvements */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
        border-radius: 0.5rem;
    }
    
    /* Image galleries and grids */
    .image-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .image-item {
        aspect-ratio: 1;
        overflow: hidden;
        border-radius: 0.5rem;
        background: var(--color-background-light);
    }
    
    .image-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Mobile loading and feedback states */
@media (max-width: 768px) {
    /* Loading spinners */
    .loading-spinner {
        width: 2rem;
        height: 2rem;
        border: 2px solid var(--color-border);
        border-top-color: var(--color-primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    /* Loading overlays */
    .loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        backdrop-filter: blur(2px);
    }
    
    .loading-content {
        background: white;
        padding: 2rem;
        border-radius: 1rem;
        text-align: center;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    }
    
    /* Toast notifications */
    .toast {
        position: fixed;
        top: 5rem;
        right: 1rem;
        left: 1rem;
        background: white;
        border-radius: 0.75rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Mobile-specific utility classes */
@media (max-width: 768px) {
    /* Display utilities */
    .mobile-hidden { display: none !important; }
    .mobile-block { display: block !important; }
    .mobile-flex { display: flex !important; }
    .mobile-grid { display: grid !important; }
    
    /* Text utilities */
    .mobile-text-xs { font-size: 0.75rem !important; }
    .mobile-text-sm { font-size: 0.875rem !important; }
    .mobile-text-base { font-size: 1rem !important; }
    .mobile-text-lg { font-size: 1.125rem !important; }
    
    /* Spacing utilities */
    .mobile-p-1 { padding: 0.25rem !important; }
    .mobile-p-2 { padding: 0.5rem !important; }
    .mobile-p-3 { padding: 0.75rem !important; }
    .mobile-p-4 { padding: 1rem !important; }
    
    .mobile-m-1 { margin: 0.25rem !important; }
    .mobile-m-2 { margin: 0.5rem !important; }
    .mobile-m-3 { margin: 0.75rem !important; }
    .mobile-m-4 { margin: 1rem !important; }
    
    /* Width utilities */
    .mobile-w-full { width: 100% !important; }
    .mobile-w-auto { width: auto !important; }
    
    /* Height utilities */
    .mobile-h-auto { height: auto !important; }
    .mobile-h-full { height: 100% !important; }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    /* Reduce animations on slower devices */
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Optimize rendering */
    .card, .modal, .sidebar {
        will-change: transform;
        transform: translateZ(0);
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Optimize touch scrolling */
    .scrollable, .main-content, .modal-body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ==========================================================================
   19. SAFE AREA AND KEYBOARD HANDLING
   ========================================================================== */

/* Safe area support for devices with notches */
@media (max-width: 768px) {
    .mobile-header {
        padding-top: calc(0.75rem + var(--safe-area-inset-top));
        padding-left: calc(1rem + var(--safe-area-inset-left));
        padding-right: calc(1rem + var(--safe-area-inset-right));
    }
    
    .main-content {
        padding-left: calc(1rem + var(--safe-area-inset-left));
        padding-right: calc(1rem + var(--safe-area-inset-right));
        padding-bottom: calc(1rem + var(--safe-area-inset-bottom));
    }
    
    .sidebar {
        padding-left: var(--safe-area-inset-left);
        padding-bottom: var(--safe-area-inset-bottom);
    }
}

/* Keyboard handling */
@media (max-width: 768px) {
    body.keyboard-open {
        height: 100vh;
        overflow: hidden;
    }
    
    body.keyboard-open .main-content {
        height: calc(100vh - 4rem); /* Account for header */
        overflow-y: auto;
    }
    
    body.keyboard-open .modal-dialog {
        position: absolute;
        top: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    body.keyboard-open .toast,
    body.keyboard-open .network-status {
        top: 1rem;
    }
}

/* Orientation-specific adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-header {
        padding: 0.5rem calc(1rem + var(--safe-area-inset-left)) 0.5rem calc(1rem + var(--safe-area-inset-right));
    }
    
    .main-content {
        padding: 0.75rem calc(1rem + var(--safe-area-inset-left)) calc(0.75rem + var(--safe-area-inset-bottom)) calc(1rem + var(--safe-area-inset-right));
    }
    
    /* Reduce modal size in landscape */
    .modal-dialog {
        max-height: calc(100vh - 1rem);
        margin: 0.5rem;
    }
    
    .modal-body {
        max-height: calc(100vh - 8rem);
    }
}

/* Full-height layouts using custom viewport units */
@media (max-width: 768px) {
    .full-height {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
    }
    
    .main-layout-container {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

/* ==========================================================================
   20. MOBILE-SPECIFIC COMPONENT OVERRIDES
   ========================================================================== */

/* Override any desktop-specific styles that don't work well on mobile */
@media (max-width: 768px) {
    /* Remove hover effects that don't make sense on touch */
    .card:hover, .edge-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    /* Simplify complex layouts */
    .complex-grid {
        display: block;
    }
    
    .complex-grid > * {
        margin-bottom: 1rem;
    }
    
    /* Ensure all interactive elements are accessible */
    button, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning,
    input, select, textarea, .form-input, .form-control, .form-select,
    a, [role="button"], [tabindex] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve readability */
    .small-text {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    /* Better spacing for lists */
    .list-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
    }
}

.edge-sidebar {
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
}

.edge-logo {
    max-width: 100%;
    height: auto;
}

.edge-logo-sm { height: 2rem; }
.edge-logo-md { height: 3rem; }
.edge-logo-lg { height: 4rem; }
.edge-logo-xl { height: 5rem; }

.edge-font {
    font-family: var(--font-family);
}

.edge-font-light { font-weight: 300; }
.edge-font-normal { font-weight: 400; }
.edge-font-medium { font-weight: 500; }
.edge-font-semibold { font-weight: 600; }
.edge-font-bold { font-weight: 700; }
