/* 
 * Shared styles for POC Clean Voice Orders site
 * Used by both public and admin sections
 */

:root {
    --primary: #6B4423;
    --primary-dark: #4A2C17;
    --secondary: #8B7355;
    --light-bg: #F5F5F0;
    --text-dark: #333333;
    --text-muted: #666666;
    
    /* Override Bootstrap's CSS variables */
    --bs-primary: #6B4423;
    --bs-primary-rgb: 107, 68, 35;
    
    --font-display: 'Red Hat Display', sans-serif;
    --font-text: 'Red Hat Text', sans-serif;
    --font-mono: 'Red Hat Mono', monospace;
}

/* Base Typography */
body {
    font-family: var(--font-text);
    color: var(--text-dark);
    background-color: var(--light-bg);
}

h1, h2, h3, h4, h5, h6,
.navbar-brand {
    font-family: var(--font-display);
}

h1, h2 {
    font-weight: 600 !important;
}

h3, h4, h5, h6 {
    font-weight: 600 !important;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

code, pre, .font-mono {
    font-family: var(--font-mono);
}

/* Fix form-switch collision with container borders and ensure switch display */
/* Only target form-switch, not regular radio buttons */
.form-check.form-switch {
    margin-left: 1rem;
    margin-right: 1rem;
}

.form-check.form-switch .form-check-label {
    padding-right: 1rem;
}

/* Ensure Bootstrap switch styles are applied - only for switches */
.form-check.form-switch .form-check-input[type="checkbox"] {
    width: 2em !important;
    height: 1em !important;
    background-color: #ccc !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255,255,255,1%29'/%3e%3c/svg%3e") !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    border-radius: 2em !important;
    margin-left: 0 !important;
    border: none !important;
}

.form-check.form-switch .form-check-input[type="checkbox"]:checked {
    background-color: var(--primary) !important;
    background-position: right center !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255,255,255,1%29'/%3e%3c/svg%3e") !important;
}

.form-check.form-switch .form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 0.25rem rgba(107, 68, 35, 0.25) !important;
}

/* Fix regular radio button positioning issues - only for radio buttons */
.form-check:not(.form-switch) .form-check-input[type="radio"] {
    margin-left: 0 !important;
}

/* Ensure checkboxes maintain proper positioning and better visibility */
.form-check .form-check-input[type="checkbox"]:not(.form-switch .form-check-input) {
    margin-left: 0 !important;
    border: 2px solid #6c757d !important;
    width: 1.2em !important;
    height: 1.2em !important;
}

.form-check .form-check-input[type="checkbox"]:not(.form-switch .form-check-input):checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.form-check .form-check-input[type="checkbox"]:not(.form-switch .form-check-input):focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(107, 68, 35, 0.25) !important;
}

/* Fix input-group-text height */
.input-group-text {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Navigation */
.navbar {
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.navbar-nav .nav-link {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--text-dark) !important;
    margin: 0 0.5rem;
}

/* Navbar link hover - more specific selector */
.navbar .navbar-nav .nav-link:hover,
.navbar-nav .nav-link:hover {
    color: #C4995C !important;
    text-decoration: none !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
}

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

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    background-color: rgba(23, 22, 21, 0.05);
    border-bottom: 1px solid rgba(23, 22, 21, 0.1);
}

.order-card {
    background: white;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.order-summary-card {
    background: white;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.order-summary-card .card-body {
    padding: 2rem;
}

/* Status Badges */
.status-badge {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 500;
    font-family: var(--font-display);
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-pending_customer {
    background-color: #e7f3ff;
    color: #0066cc;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 1.5rem;
    bottom: -1.5rem;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.timeline-content {
    margin-left: 0.5rem;
}

/* Special Elements */
.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.script-preview {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.script-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f8f9fa);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.file-item:last-child {
    margin-bottom: 0;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Forms */
.form-control, .form-select {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.form-label {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.form-check {
    padding: 0.5rem 0;
}

.form-check-label {
    padding-left: 0.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

/* Tables */
.table {
    margin-bottom: 1.5rem;
}

.table td, .table th {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Admin specific styles */
.sidebar {
    min-height: calc(100vh - 76px);
    background-color: white;
    border-right: 1px solid #dee2e6;
    padding: 1.5rem 0;
}

.sidebar .nav-link {
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    font-family: var(--font-display);
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: var(--light-bg);
    color: var(--primary);
}

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

.stat-card {
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: transform 0.2s;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Spacing Utilities */
.section-padding {
    padding: 2rem 0;
}

.container-padding {
    padding: 1.5rem;
}

/* Improved spacing for specific elements */
.list-group-item {
    padding: 1rem 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-header {
    padding: 1rem 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
}

/* Better spacing between sections */
section {
    margin-bottom: 2rem;
}

.mb-section {
    margin-bottom: 3rem;
}

.py-section {
    padding: 3rem 0;
}

/* Override Bootstrap blue defaults */
a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* Nuclear option - override Bootstrap's exact blue */
* {
    --bs-primary: #171615 !important;
    --bs-primary-rgb: 23, 22, 21 !important;
}

/* Force outline-primary button styling */
.btn.btn-outline-primary, 
a.btn.btn-outline-primary,
.btn-outline-primary {
    color: #171615 !important;
    border-color: #171615 !important;
    background-color: transparent !important;
}

.btn.btn-outline-primary:hover, 
.btn.btn-outline-primary:focus, 
.btn.btn-outline-primary:active,
a.btn.btn-outline-primary:hover, 
a.btn.btn-outline-primary:focus, 
a.btn.btn-outline-primary:active,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #171615 !important;
    border-color: #171615 !important;
    color: white !important;
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.alert-primary {
    background-color: rgba(23, 22, 21, 0.1);
    border-color: rgba(23, 22, 21, 0.2);
    color: var(--primary);
}

.btn-sm.btn-primary, .btn-lg.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-sm.btn-primary:hover, .btn-lg.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm.btn-outline-primary, .btn-lg.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-sm.btn-outline-primary:hover, .btn-lg.btn-outline-primary:hover,
.btn-sm.btn-outline-primary:focus, .btn-lg.btn-outline-primary:focus,
.btn-sm.btn-outline-primary:active, .btn-lg.btn-outline-primary:active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(23, 22, 21, 0.25);
}

/* Checkbox styling - force earth-tone colors */
/* NUCLEAR OVERRIDE - Maximum specificity to beat Bootstrap */
input[type="checkbox"].form-check-input,
input.form-check-input[type="checkbox"],
.form-check input[type="checkbox"],
.form-check .form-check-input,
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    border: 1px solid #ced4da;
}

input[type="checkbox"].form-check-input:checked,
input.form-check-input[type="checkbox"]:checked,
.form-check input[type="checkbox"]:checked,
.form-check .form-check-input:checked,
.form-check-input:checked,
input[type="checkbox"]:checked.form-check-input {
    background-color: #171615 !important;
    border-color: #171615 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

input[type="checkbox"].form-check-input:focus,
input.form-check-input[type="checkbox"]:focus,
.form-check input[type="checkbox"]:focus,
.form-check .form-check-input:focus,
.form-check-input:focus {
    border-color: #171615 !important;
    box-shadow: 0 0 0 0.2rem rgba(23, 22, 21, 0.25) !important;
    outline: 0 !important;
}

/* Focus-visible state */
input[type="checkbox"].form-check-input:focus-visible,
.form-check-input:focus-visible {
    border-color: #171615 !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(23, 22, 21, 0.25) !important;
}

/* Hover states */
input[type="checkbox"].form-check-input:hover,
input.form-check-input[type="checkbox"]:hover,
.form-check input[type="checkbox"]:hover,
.form-check .form-check-input:hover,
.form-check-input:hover {
    border-color: #171615 !important;
}

/* Active state */
input[type="checkbox"].form-check-input:active,
.form-check-input:active {
    filter: brightness(90%);
}

/* Indeterminate state */
input[type="checkbox"].form-check-input:indeterminate,
.form-check-input:indeterminate {
    background-color: #171615 !important;
    border-color: #171615 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M5 10h10'/%3e%3c/svg%3e") !important;
}

/* Disabled state */
input[type="checkbox"].form-check-input:disabled,
.form-check-input:disabled {
    opacity: 0.5;
}

/* Override any Bootstrap 5.x variables or compiled styles */
.form-check-input[type="checkbox"] {
    --bs-form-check-bg: transparent;
}

.form-check-input[type="checkbox"]:checked {
    --bs-form-check-bg: #171615;
}

/* Form switches (toggles) specific styling */
.form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,0.85)'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(23,22,21,0.25)'/%3e%3c/svg%3e");
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .order-summary-card .card-body {
        padding: 1.5rem;
    }
    
    .container-padding {
        padding: 1rem;
    }
}
/* Reference Materials Styling */
.reference-materials {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.reference-materials h6 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.reference-materials-content {
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-dark);
}
