/* Custom styles for Barry's Order Management System */

/* Barry's brand colors and styling */
:root {
    --barry-red: #E50000;
    --barry-dark: #1a1a1a;
    --barry-light-gray: #f8f9fa;
    --barry-black: #000000;
    --barry-green: #28a745;
}

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

/* Brand specific styling */
.navbar-brand img {
    filter: brightness(1.1);
}

.btn-primary {
    background-color: #212529;
    border-color: #212529;
}

.btn-primary:hover, 
.btn-primary:focus, 
.btn-primary:active {
    background-color: #1a1e21;
    border-color: #1a1e21;
}

.btn-success {
    background-color: #212529;
    border-color: #212529;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #1a1e21;
    border-color: #1a1e21;
}

.btn-outline-primary {
    border-color: #212529;
    color: #212529;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #212529;
    border-color: #212529;
    color: white;
}

/* btn-outline-secondary styling is now handled further down in the file */

/* Override ALL primary and success buttons to match header */
.btn-primary,
.btn-success,
#addToGridBtn,
#addItemBtn,
#fullscreenBtn,
#generateOrderBtn {
    background-color: #212529 !important;
    border-color: #212529 !important;
    color: white !important;
}

.btn-primary:hover,
.btn-success:hover,
#addToGridBtn:hover,
#addItemBtn:hover,
#fullscreenBtn:hover,
#generateOrderBtn:hover {
    background-color: #1a1e21 !important;
    border-color: #1a1e21 !important;
    color: white !important;
}

/* Disabled button state */
.btn:disabled,
.btn.disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    opacity: 0.65;
}

/* Card enhancements */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Form enhancements */
.form-control,
.form-select {
    background-color: #fff !important;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #000 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--barry-black);
}

/* Location selection - COMPLETELY remove all highlights and boxes */
.location-item,
.location-item *,
.location-item input,
.location-item span {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
}

.location-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: none !important;
}

.location-item:hover {
    background-color: #f8f9fa !important;
}

.location-item:focus,
.location-item:focus-within,
.location-item:active,
.location-item:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    border: none !important;
}

/* Checkboxes - no highlighting at all */
.location-checkbox,
input[type="checkbox"].location-checkbox {
    outline: none !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: white !important;
    appearance: auto !important;
}

.location-checkbox:focus,
.location-checkbox:active,
input[type="checkbox"].location-checkbox:focus {
    outline: none !important;
    box-shadow: none !important;
    border: 1px solid #666 !important;
    background: white !important;
}

/* Text styling for checked items */
.location-item input[type="checkbox"]:checked + .location-text {
    font-weight: 600;
    color: #212529;
}

/* Override any Bootstrap focus styles on location items */
.location-list .location-item:focus-visible {
    outline: none !important;
}

/* Remove highlights but keep functionality */
.nav-link:focus,
.nav-link:active,
.nav-link:focus-visible,
.btn-outline-light:focus,
.btn-outline-light:active,
.btn-outline-light:focus-visible,
.btn-light:focus-visible,
.btn-sm:focus,
.btn-sm:active,
.btn-sm:focus-visible,
a.btn:focus,
a.btn:active,
a.btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Keep buttons clickable */
.btn,
a.btn,
button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Remove white background only from navbar buttons */
.btn-outline-light,
.navbar .btn-outline-light {
    background-color: transparent !important;
    background: transparent !important;
}

.btn-outline-light:hover,
.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure sort buttons and other outline-secondary buttons are visible */
.btn-outline-secondary,
.btn-xs.btn-outline-secondary {
    color: #495057 !important;
    border-color: #495057 !important;
    background-color: #ffffff !important;
    font-weight: 600 !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-xs.btn-outline-secondary:hover,
.btn-xs.btn-outline-secondary:focus,
.btn-xs.btn-outline-secondary:active {
    background-color: #495057 !important;
    color: #ffffff !important;
    border-color: #495057 !important;
}

/* Make sure no global focus styles affect location items */
*:focus-visible {
    outline: revert;
}

.location-item *:focus-visible,
.location-item:focus-visible {
    outline: none !important;
}

/* Ensure all text inputs and numbers are black */
input[type="text"],
input[type="number"],
textarea,
select {
    color: #000 !important;
}

/* Make edit buttons highly visible - FORCE white text on dark background */
.btn-light,
a.btn.btn-light,
button.btn.btn-light {
    background-color: #000000 !important;
    border-color: #333333 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.3) !important;
    font-size: 14px !important;
}

.btn-light:hover,
.btn-light:focus,
.btn-light:active,
a.btn.btn-light:hover,
a.btn.btn-light:focus,
a.btn.btn-light:active,
button.btn.btn-light:hover,
button.btn.btn-light:focus,
button.btn.btn-light:active {
    background-color: #333333 !important;
    border-color: #555555 !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.3) !important;
}

/* Clean, professional outline-primary buttons (like Add All Locations) */
.btn-outline-primary {
    background-color: #ffffff !important;
    color: #212529 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: 2px solid #212529 !important;
    border-radius: 6px !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #212529 !important;
    color: #ffffff !important;
    border-color: #212529 !important;
    transform: none !important;
}

/* Sort buttons styling */
.btn-xs {
    padding: 2px 6px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/* This rule is now handled above with better specificity */

/* Table header styling for sort buttons */
th {
    white-space: nowrap;
}

/* Location quantity inputs */
.qty-input-small {
    color: #000 !important;
    background-color: #fff !important;
}

/* Placeholder text */
::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

/* Text color changes */
.text-primary {
    color: var(--barry-black) !important;
}

/* Button enhancements */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Table enhancements */
.table th {
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: var(--bs-light);
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--bs-success);
}

.alert-danger {
    border-left-color: var(--bs-danger);
}

/* Badge enhancements */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* Navbar enhancements */
.navbar-brand {
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 6px;
        margin-bottom: 2px;
    }
    
    .table-responsive {
        font-size: 0.875em;
    }
}

/* Loading states */
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    opacity: 0.3;
}

/* Form validation */
.is-invalid {
    border-color: var(--bs-danger);
}

.invalid-feedback {
    display: block;
    color: var(--bs-danger);
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* White background override */
body {
    background-color: #ffffff !important;
}

.card {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.navbar-dark {
    background-color: var(--barry-dark) !important;
}

/* Order preview styling */
.order-preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.order-item {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 12px;
}

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

/* Larger club selection */
.club-select-large {
    min-height: 300px !important;
}

/* Search functionality */
.location-search {
    margin-bottom: 10px;
}

/* Multi-select styling */
.location-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: white;
}

.location-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.location-item:hover {
    background-color: #f8f9fa;
}

.location-item.selected {
    background-color: #e7f3ff;
    border-left: 3px solid var(--barry-black);
}

.location-item:last-child {
    border-bottom: none;
}

.location-item input[type="checkbox"] {
    margin-right: 8px;
}

.selected-locations-summary {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    min-height: 60px;
}

/* Selected locations grid */
.selected-locations-grid {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.location-qty-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: between;
    align-items: center;
}

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

.location-name {
    flex: 1;
    font-size: 0.85em;
    margin-right: 8px;
}

.qty-input-small {
    width: 60px;
}

/* Excel-style preview */
.excel-preview {
    background-color: white;
    border: 1px solid #ccc;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    overflow-x: auto;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.excel-table th,
.excel-table td {
    border: 1px solid #000;
    padding: 2px 4px;
    text-align: left;
    white-space: nowrap;
    min-width: 80px;
    font-size: 10px;
    color: #000;
}

.excel-table th {
    background-color: #f0f0f0;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.preview-collapsed {
    max-height: 40px;
    overflow: hidden;
}

.preview-expanded {
    max-height: 400px;
    overflow-y: auto;
}

/* Full-screen preview modal */
.fullscreen-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    padding: 20px;
}

.fullscreen-content {
    background-color: white;
    height: 100%;
    border-radius: 8px;
    overflow: auto;
    position: relative;
}

.fullscreen-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fullscreen-close {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.fullscreen-close:hover {
    background: #c82333;
}

.fullscreen-excel {
    padding: 20px;
    font-family: 'Arial', sans-serif;
    font-size: 12px;
}

.fullscreen-excel table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.fullscreen-excel th,
.fullscreen-excel td {
    border: 1px solid #000;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
    color: #000;
}

.fullscreen-excel th {
    background-color: #f0f0f0;
    font-weight: bold;
    position: sticky;
    top: 60px;
}
