/* Advanced Mailing System - BrainSell Brand Styles v3.3 with All Fixes */
:root {
    /* BrainSell Brand Colors */
    --brainsell-orange: #FF8C00;
    --brainsell-orange-dark: #E67E00;
    --brainsell-orange-light: #FFA500;
    --brainsell-gray: #6B6B6B;
    --brainsell-gray-dark: #4A4A4A;
    --brainsell-gray-light: #F5F5F5;
    
    /* System Colors */
    --ams-primary: #FF8C00;
    --ams-primary-dark: #E67E00;
    --ams-secondary: #6B6B6B;
    --ams-success: #28a745;
    --ams-warning: #FFA500;
    --ams-danger: #dc3545;
    --ams-info: #17a2b8;
    --ams-light: #f8f9fa;
    --ams-dark: #4A4A4A;
    --ams-gray: #6B6B6B;
    --ams-gray-light: #e9ecef;
    --ams-border-radius: 8px;
    --ams-box-shadow: 0 2px 10px rgba(255, 140, 0, 0.1);
    --ams-box-shadow-hover: 0 4px 20px rgba(255, 140, 0, 0.2);
    --ams-transition: all 0.3s ease;
}

/* Container */
.mailing-form-container-pro {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.form-header-pro {
    background: linear-gradient(135deg, var(--brainsell-orange) 0%, var(--brainsell-orange-dark) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.form-header-pro::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-header-pro h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.form-header-pro p {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

/* Daily Statistics Dashboard - Modified for Letters/Postcards */
.daily-stats-dashboard-pro {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    padding: 25px 30px;
    border-bottom: 2px solid var(--brainsell-orange);
}

.daily-stats-dashboard-pro h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--brainsell-gray-dark);
    font-weight: 600;
}

.stats-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item-pro {
    background: white;
    padding: 15px 20px;
    border-radius: var(--ams-border-radius);
    box-shadow: 0 2px 10px rgba(255, 140, 0, 0.1);
    text-align: center;
    transition: var(--ams-transition);
    border-left: 3px solid var(--brainsell-orange);
}

.stat-item-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.2);
}

.stat-item-pro.highlight-total {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    border: 2px solid var(--brainsell-orange);
    border-left: 3px solid var(--brainsell-orange);
}

.stat-item-pro label {
    display: block;
    font-size: 13px;
    color: var(--brainsell-gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-item-pro span {
    font-size: 28px;
    font-weight: 700;
    color: var(--brainsell-orange);
}

/* Form Body */
#mailing-order-form {
    padding: 30px;
}

/* Form Sections */
.form-section-pro {
    background: var(--ams-light);
    padding: 30px;
    border-radius: var(--ams-border-radius);
    margin-bottom: 25px;
    border-left: 4px solid var(--brainsell-orange);
    transition: var(--ams-transition);
}

.form-section-pro:hover {
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.1);
}

.section-title-pro {
    font-size: 20px;
    font-weight: 600;
    color: var(--brainsell-gray-dark);
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brainsell-orange);
}

.subsection-title-pro {
    font-size: 16px;
    font-weight: 600;
    color: var(--ams-dark);
    margin: 0 0 15px 0;
}

.section-description-pro {
    color: var(--ams-gray);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Inventory Notice Styles */
.inventory-notice-pro {
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    margin-bottom: 20px;
    transition: var(--ams-transition);
}

.inventory-notice-pro.letter-mode {
    background: #fff5f0;
    border-left-color: var(--brainsell-orange);
}

.inventory-notice-pro.postcard-mode {
    background: #f0fff4;
    border-left-color: var(--ams-success);
}

/* Form Layout */
.form-row-pro {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-pro.two-columns {
    grid-template-columns: 1fr 1fr;
}

.form-row-pro.three-columns {
    grid-template-columns: repeat(3, 1fr);
}

/* Form Groups */
.form-group-pro {
    display: flex;
    flex-direction: column;
}

.form-group-pro label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.form-group-pro label .required {
    color: var(--ams-danger);
    margin-left: 4px;
    font-weight: 700;
}

/* Form Controls */
.form-control-pro {
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: var(--ams-transition);
    background: white;
    font-family: inherit;
}

.form-control-pro:focus {
    border-color: var(--brainsell-orange);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.form-control-pro:read-only {
    background: var(--ams-gray-light);
    cursor: not-allowed;
    color: var(--brainsell-gray);
}

.form-control-pro:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
}

select.form-control-pro {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

textarea.form-control-pro {
    resize: vertical;
    min-height: 100px;
}

/* Date Input Styling */
.dates-container-pro {
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: var(--ams-border-radius);
    border: 1px solid var(--ams-gray-light);
}

.date-input-pro {
    position: relative;
}

/* Job ID Field Special Styling */
.job-id-container-pro {
    position: relative;
}

.job-id-wrapper {
    position: relative;
}

.job-id-field {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--brainsell-orange);
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%) !important;
    font-size: 16px;
    border: 2px solid var(--brainsell-orange) !important;
}

.auto-generated-label {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--ams-gray);
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--ams-gray-light);
    font-weight: 500;
}

/* Checkbox Groups */
.checkbox-group-pro {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.checkbox-item-pro {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: var(--ams-transition);
}

.checkbox-item-pro:hover {
    border-color: var(--brainsell-orange);
    background: linear-gradient(135deg, #fff5f0 0%, #fff 100%);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.1);
}

.checkbox-item-pro input[type="checkbox"]:checked {
    accent-color: var(--brainsell-orange);
}

.checkbox-item-pro input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-item-pro label {
    cursor: pointer;
    margin: 0;
    font-weight: 400;
    font-size: 14px;
}

/* Radio Groups */
.radio-group-pro {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-item-pro {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: var(--ams-transition);
}

.radio-item-pro:hover {
    border-color: var(--brainsell-orange);
    background: linear-gradient(135deg, #fff5f0 0%, #fff 100%);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.1);
}

.radio-item-pro input[type="radio"]:checked {
    accent-color: var(--brainsell-orange);
}

.radio-item-pro input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.radio-item-pro label {
    cursor: pointer;
    margin: 0;
    font-weight: 400;
    font-size: 14px;
}

/* Add visual feedback when radio is selected */
.radio-item-pro:has(input[type="radio"]:checked) {
    border-color: var(--brainsell-orange);
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    box-shadow: 0 2px 10px rgba(255, 140, 0, 0.15);
}

/* File Upload Section */
.file-upload-container-pro {
    border: 2px dashed var(--brainsell-orange);
    border-radius: var(--ams-border-radius);
    background: white;
    transition: var(--ams-transition);
}

.file-upload-container-pro.drag-over {
    border-color: var(--ams-success);
    background: rgba(40, 167, 69, 0.05);
    transform: scale(1.02);
}

.file-upload-area-pro {
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--ams-transition);
}

.file-upload-area-pro:hover {
    background: linear-gradient(135deg, #fff5f0 0%, #fff 100%);
}

.upload-icon-pro {
    color: var(--brainsell-orange);
    margin-bottom: 15px;
}

.upload-text-pro {
    color: var(--ams-dark);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-subtext-pro {
    color: var(--ams-gray);
    font-size: 13px;
}

.file-input-pro {
    display: none;
}

.file-upload-progress-pro {
    display: none;
    padding: 20px;
}

.progress-bar-pro {
    width: 100%;
    height: 8px;
    background: var(--ams-gray-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-pro {
    height: 100%;
    background: linear-gradient(135deg, var(--brainsell-orange) 0%, var(--brainsell-orange-dark) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text-pro {
    text-align: center;
    font-size: 13px;
    color: var(--ams-gray);
    margin-top: 10px;
}

.file-previews-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.file-preview-item-pro {
    background: white;
    border: 1px solid var(--ams-gray-light);
    border-radius: var(--ams-border-radius);
    padding: 15px;
    text-align: center;
    transition: var(--ams-transition);
}

.file-preview-item-pro:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.file-preview-image-pro img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 4px;
}

.file-preview-info-pro {
    margin-top: 10px;
}

.file-preview-name-pro {
    font-size: 13px;
    font-weight: 500;
    color: var(--ams-dark);
    margin-bottom: 5px;
    word-break: break-all;
}

.file-preview-size-pro {
    font-size: 11px;
    color: var(--ams-gray);
    margin-bottom: 10px;
}

.file-action-btn-pro {
    background: var(--ams-danger);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--ams-transition);
}

.file-action-btn-pro:hover {
    background: #c82333;
}

/* Location-based upload styles - NEW FOR ISSUE #5 */
#location-based-uploads {
    margin-top: 20px;
}

#location-upload-containers {
    display: grid;
    gap: 20px;
}

.location-upload-section {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 8px;
    border-left: 3px solid var(--brainsell-orange);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.location-upload-section h4 {
    margin: 0 0 10px 0;
    color: var(--brainsell-gray-dark);
    font-size: 16px;
    font-weight: 600;
}

.location-upload-section .field-help-pro {
    color: var(--ams-gray);
    font-size: 13px;
    margin-bottom: 15px;
    font-style: italic;
}

.location-specific .file-upload-container-pro {
    border: 2px dashed #28a745;
}

.location-specific .file-upload-area-pro {
    padding: 25px;
    min-height: 120px;
}

.location-file-preview {
    padding: 10px;
    min-height: 50px;
}

.location-file-item {
    background: #f0fff4;
    border: 1px solid #28a745;
}

/* Editable location names - NEW FOR ISSUE #2 */
.editable-location {
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editable-location:hover {
    background: rgba(255, 140, 0, 0.1);
}

.editable-location:focus {
    background: white;
    outline: 2px solid var(--brainsell-orange);
    outline-offset: 2px;
}

/* Locations Grid - Modified for 4x3 Layout */
.locations-grid-pro {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.location-item-pro {
    background: white;
    padding: 20px;
    border-radius: var(--ams-border-radius);
    border: 2px solid var(--ams-gray-light);
    transition: var(--ams-transition);
    position: relative;
}

.location-item-pro:hover {
    border-color: var(--brainsell-orange);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.15);
    transform: translateY(-2px);
}

.location-item-pro.has-quantity {
    border-color: var(--ams-success);
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
}

.location-item-pro.location-unassigned {
    opacity: 0.6;
    background: #f8f9fa;
}

.location-item-pro.location-unassigned .location-code-pro {
    background: #6c757d;
}

/* Texas and Custom locations should not be disabled */
.location-item-pro[data-location="texas"],
.location-item-pro[data-location="custom_1"],
.location-item-pro[data-location="custom_2"],
.location-item-pro[data-location="custom_3"] {
    opacity: 1;
    background: white;
}

.location-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.location-name-pro {
    font-weight: 600;
    color: var(--brainsell-gray-dark);
    font-size: 15px;
}

.location-code-pro {
    background: var(--brainsell-orange);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.location-item-pro.has-quantity .location-code-pro {
    background: var(--ams-success);
}

/* Location Inventory Display */
.location-inventory-display {
    margin: 10px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.inventory-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.inventory-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s ease;
}

.inventory-fill.low {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.inventory-fill.critical {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.inventory-text {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-inventory {
    font-weight: 600;
    color: #28a745;
}

.remaining-inventory {
    color: var(--brainsell-orange);
    font-weight: 600;
    font-size: 11px;
}

.location-input-pro input {
    width: 100%;
}

/* Total Counter */
.total-counter-pro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #fff 0%, #fff5f0 100%);
    border-radius: var(--ams-border-radius);
    border: 2px solid var(--brainsell-orange-light);
    margin-bottom: 20px;
}

.counter-item-pro {
    text-align: center;
}

.counter-item-pro label {
    display: block;
    font-size: 12px;
    color: var(--brainsell-gray);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.counter-item-pro span {
    font-size: 24px;
    font-weight: 700;
    color: var(--brainsell-orange);
}

/* Price Estimator Styles - ENHANCED FOR ISSUE #1 */
.price-estimator-pro {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fd 100%);
    border: 2px solid #007cba;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

.estimator-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.estimate-row.total {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    border: 1px solid #FF8C00;
    padding: 12px;
    margin-top: 10px;
}

.estimate-label {
    font-size: 14px;
    color: #495057;
}

.estimate-value {
    font-size: 16px;
    font-weight: 600;
    color: #FF8C00;
}

.estimate-note {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-top: 10px;
    text-align: center;
}

/* Capacity Status */
.capacity-status-pro {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--ams-border-radius);
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.capacity-status-pro.success {
    background: #d4edda;
    border: 2px solid var(--ams-success);
    color: #155724;
}

.capacity-status-pro.warning {
    background: #fff3cd;
    border: 2px solid var(--ams-warning);
    color: #856404;
}

.capacity-status-pro.danger {
    background: #f8d7da;
    border: 2px solid var(--ams-danger);
    color: #721c24;
}

#capacity-message {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

#capacity-details {
    font-size: 14px;
    line-height: 1.6;
}

/* Services Grid */
.services-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* Order Preview */
.order-preview-section-pro {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid var(--ams-success);
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
    animation: slideIn 0.5s ease;
}

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

.preview-content-pro {
    display: grid;
    gap: 20px;
}

.preview-section-pro {
    padding: 15px;
    background: white;
    border-radius: var(--ams-border-radius);
}

.preview-section-pro h4 {
    margin: 0 0 15px 0;
    color: var(--brainsell-gray-dark);
    font-size: 16px;
}

.location-breakdown-pro {
    display: grid;
    gap: 10px;
}

.breakdown-item-pro {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cost-table-pro {
    width: 100%;
    border-collapse: collapse;
}

.cost-table-pro td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.cost-table-pro .total-row-pro td {
    border-bottom: none;
    border-top: 2px solid var(--brainsell-orange);
    padding-top: 12px;
    font-size: 16px;
}

.capacity-check-pro {
    padding: 15px;
    border-radius: var(--ams-border-radius);
    text-align: center;
}

.capacity-check-pro.success {
    background: #d4edda;
    color: #155724;
}

.capacity-check-pro.danger {
    background: #f8d7da;
    color: #721c24;
}

/* Form Actions */
.form-actions-pro {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--brainsell-orange-light);
}

.btn-pro {
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ams-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary-pro {
    background: linear-gradient(135deg, var(--brainsell-orange) 0%, var(--brainsell-orange-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.btn-primary-pro:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
    background: linear-gradient(135deg, var(--brainsell-orange-light) 0%, var(--brainsell-orange) 100%);
}

.btn-secondary-pro {
    background: var(--brainsell-gray);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 107, 107, 0.3);
}

.btn-secondary-pro:hover:not(:disabled) {
    background: var(--brainsell-gray-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 107, 107, 0.4);
}

/* Reset button styles */
.btn-reset-pro {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-reset-pro:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-pro:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-pro.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Field Help Text */
.field-help-pro {
    display: block;
    margin-top: 5px;
    color: var(--ams-gray);
    font-size: 12px;
    line-height: 1.4;
}

/* Field Errors */
.field-error-pro {
    color: var(--ams-danger);
    font-size: 12px;
    margin-top: 5px;
}

.form-control-pro.error {
    border-color: var(--ams-danger);
}

/* Success Message */
.success-message-pro,
.error-message-pro,
.warning-message-pro,
.info-message-pro,
.message-pro {
    padding: 15px 20px;
    border-radius: var(--ams-border-radius);
    margin-bottom: 20px;
    animation: slideDown 0.5s ease;
}

.success-message-pro {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-message-pro {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.warning-message-pro {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.info-message-pro {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

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

/* Success Modal */
.success-modal-overlay-pro {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.success-modal-pro {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.success-icon-pro {
    font-size: 60px;
    margin-bottom: 20px;
}

.success-modal-pro h2 {
    color: var(--brainsell-gray-dark);
    margin-bottom: 20px;
}

.order-summary-pro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--ams-border-radius);
    margin-bottom: 20px;
    text-align: left;
}

.order-summary-pro p {
    margin: 8px 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .locations-grid-pro {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .form-header-pro {
        padding: 30px 20px;
    }
    
    .form-header-pro h1 {
        font-size: 24px;
    }
    
    #mailing-order-form {
        padding: 20px;
    }
    
    .form-section-pro {
        padding: 20px;
    }
    
    .form-row-pro.two-columns,
    .form-row-pro.three-columns {
        grid-template-columns: 1fr;
    }
    
    .stats-grid-pro {
        grid-template-columns: 1fr 1fr;
    }
    
    .locations-grid-pro {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkbox-group-pro,
    .radio-group-pro,
    .services-grid-pro {
        grid-template-columns: 1fr;
    }
    
    .form-actions-pro {
        flex-direction: column;
    }
    
    .btn-pro {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid-pro {
        grid-template-columns: 1fr;
    }
    
    .locations-grid-pro {
        grid-template-columns: 1fr;
    }
    
    .total-counter-pro {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .form-actions-pro,
    .daily-stats-dashboard-pro,
    .file-upload-container-pro {
        display: none;
    }
    
    .mailing-form-container-pro {
        box-shadow: none;
    }
    
    .form-section-pro {
        break-inside: avoid;
    }
}

/* Add these additional CSS rules to your existing mailing-form.css file */

/* File Preview Actions - Enhanced for VIEW button */
.file-preview-actions-pro {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.file-action-btn-pro {
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--ams-transition);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* VIEW button specific styles */
.file-view-btn, 
.location-file-view-btn {
    background: #007cba !important;
    color: white;
}

.file-view-btn:hover, 
.location-file-view-btn:hover {
    background: #005a87 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 186, 0.3);
}

/* REMOVE button styles */
.file-remove-btn,
.location-file-remove-btn {
    background: var(--ams-danger);
    color: white;
}

.file-remove-btn:hover,
.location-file-remove-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Ensure buttons stay visible and properly aligned */
.file-preview-item-pro {
    position: relative;
    background: white;
    border: 1px solid var(--ams-gray-light);
    border-radius: var(--ams-border-radius);
    padding: 15px;
    text-align: center;
    transition: var(--ams-transition);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.location-file-item {
    background: #f0fff4;
    border: 1px solid #28a745;
}

.file-preview-info-pro {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Make sure the preview sections show files properly */
.location-file-preview {
    padding: 10px;
    min-height: 50px;
}

/* Enhanced visibility for inventory after submission */
.location-inventory-display .inventory-text {
    transition: all 0.3s ease;
}

.location-inventory-display .current-inventory {
    font-weight: 600;
    color: #28a745;
    font-size: 14px;
}

/* Better visual feedback when quantities are reset */
.quantity-field {
    transition: all 0.3s ease;
}

.quantity-field:focus {
    border-color: var(--brainsell-orange);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* Ensure inventory bars update smoothly */
.inventory-fill {
    transition: width 0.5s ease, background 0.3s ease;
}

/* ADD THESE STYLES TO THE END OF YOUR EXISTING mailing-form.css FILE */

/* ============================================
   CRITICAL FIXES FOR LOCATION UPLOAD FUNCTIONALITY
   ============================================ */

/* Location Upload Sections - CRITICAL FIX */
#location-based-uploads {
    margin-top: 20px;
}

#location-upload-containers {
    display: grid;
    gap: 20px;
}

.location-upload-section {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 8px;
    border-left: 3px solid var(--brainsell-orange);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.location-upload-section:hover {
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.15);
}

.location-upload-section h4 {
    margin: 0 0 10px 0;
    color: var(--brainsell-gray-dark);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-upload-section .field-help-pro {
    color: var(--ams-gray);
    font-size: 13px;
    margin-bottom: 15px;
    font-style: italic;
}

/* Location specific upload containers */
.location-specific .file-upload-container-pro {
    border: 2px dashed #28a745 !important;
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
}

.location-specific .file-upload-container-pro:hover {
    border-color: #20c997 !important;
    background: linear-gradient(135deg, #e6ffed 0%, #fff 100%);
}

.location-specific .file-upload-container-pro.drag-over {
    border-color: #28a745 !important;
    background: rgba(40, 167, 69, 0.1) !important;
    transform: scale(1.01);
}

.location-specific .file-upload-area-pro {
    padding: 25px;
    min-height: 120px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.location-specific .file-upload-area-pro:hover {
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
}

.location-specific .upload-icon-pro {
    color: #28a745;
}

.location-specific .upload-text-pro {
    color: var(--brainsell-gray-dark);
    font-size: 15px;
    font-weight: 500;
    margin-top: 10px;
}

.location-specific .upload-subtext-pro {
    color: var(--ams-gray);
    font-size: 12px;
    margin-top: 5px;
}

/* Location file preview */
.location-file-preview {
    padding: 10px;
    min-height: 50px;
}

.location-file-preview:not(:empty) {
    margin-top: 15px;
}

.location-file-item {
    background: #f0fff4;
    border: 1px solid #28a745;
    position: relative;
    transition: all 0.3s ease;
}

.location-file-item:hover {
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

/* Fix for file preview actions */
.file-preview-actions-pro {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.file-action-btn-pro {
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* VIEW button specific styles */
.file-view-btn, 
.location-file-view-btn {
    background: #007cba !important;
    color: white;
}

.file-view-btn:hover, 
.location-file-view-btn:hover {
    background: #005a87 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 186, 0.3);
}

/* REMOVE button styles */
.file-remove-btn,
.location-file-remove-btn {
    background: var(--ams-danger) !important;
    color: white;
}

.file-remove-btn:hover,
.location-file-remove-btn:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Ensure buttons stay visible and properly aligned */
.file-preview-item-pro {
    position: relative;
    background: white;
    border: 1px solid var(--ams-gray-light);
    border-radius: var(--ams-border-radius);
    padding: 15px;
    text-align: center;
    transition: var(--ams-transition);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.file-preview-info-pro {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
    justify-content: space-between;
}

/* Enhanced visibility for inventory after submission */
.location-inventory-display {
    transition: all 0.3s ease;
    margin: 10px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.location-inventory-display .inventory-text {
    transition: all 0.3s ease;
    font-size: 12px;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-inventory-display .current-inventory {
    font-weight: 600;
    color: #28a745;
    font-size: 14px;
}

.location-inventory-display .remaining-inventory {
    color: var(--brainsell-orange);
    font-weight: 600;
    font-size: 11px;
}

/* Better visual feedback when quantities are reset */
.quantity-field {
    transition: all 0.3s ease;
}

.quantity-field:focus {
    border-color: var(--brainsell-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1) !important;
}

.quantity-field.has-value {
    background-color: #fff5f0;
    border-color: var(--brainsell-orange);
}

/* Ensure inventory bars update smoothly */
.inventory-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
}

.inventory-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.5s ease, background 0.3s ease;
    position: relative;
}

.inventory-fill.low {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.inventory-fill.critical {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

/* Responsive improvements for location uploads */
@media (max-width: 768px) {
    .location-upload-section {
        padding: 15px;
    }
    
    .location-upload-section h4 {
        font-size: 14px;
    }
    
    .location-specific .file-upload-area-pro {
        padding: 20px;
        min-height: 100px;
    }
    
    .location-specific .upload-text-pro {
        font-size: 14px;
    }
    
    .location-specific .upload-subtext-pro {
        font-size: 11px;
    }
}

/* Print styles */
@media print {
    #location-based-uploads,
    .location-upload-section {
        display: none !important;
    }
}

/* Loading states */
.location-upload-section.uploading {
    opacity: 0.7;
    pointer-events: none;
}

.location-upload-section.uploading::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    top: 50%;
    left: 50%;
    margin-left: -15px;
    margin-top: -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--brainsell-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Fix for empty state */
#location-upload-containers:empty::before {
    content: 'Select quantities for locations to enable file uploads';
    display: block;
    padding: 20px;
    text-align: center;
    color: var(--ams-gray);
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Ensure proper z-index hierarchy */
.file-upload-area-pro {
    position: relative;
    z-index: 1;
}

.file-upload-container-pro {
    position: relative;
    z-index: 2;
}

.location-upload-section {
    position: relative;
    z-index: 3;
}

/* Message animations */
.message-pro {
    animation: slideDown 0.5s ease;
}

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

/* Fix for file input hidden state */
.file-input-pro,
.location-file-input {
    display: none !important;
    position: absolute;
    left: -9999px;
}

/* Editable location name improvements */
.editable-location {
    cursor: text;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 80px;
}

.editable-location:hover {
    background: rgba(255, 140, 0, 0.1);
    outline: 1px dashed var(--brainsell-orange);
}

.editable-location:focus {
    background: white;
    outline: 2px solid var(--brainsell-orange);
    outline-offset: 2px;
}

/* Final touches for better UX */
.location-item-pro.has-quantity {
    border-color: var(--ams-success);
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.1);
}

.location-item-pro.has-quantity .location-code-pro {
    background: var(--ams-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* ========================================
   ENHANCED MULTI-FILE UPLOAD STYLES v3.5.0
   ======================================== */

.upload-notice-enhanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-notice-enhanced .field-help-pro {
    color: white !important;
    margin: 8px 0;
    font-size: 14px;
}

.location-upload-section-enhanced {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.location-upload-section-enhanced:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #FF8C00;
}

.location-header-enhanced {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #FF8C00;
}

.location-header-enhanced h3 {
    color: #333;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-header-enhanced strong {
    color: #FF8C00;
}

.upload-category-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-category-container:hover {
    background: #fff;
    border-color: #FF8C00;
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.category-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 15px 0;
}

.multi-file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.multi-file-upload-area:hover {
    border-color: #FF8C00;
    background: #fff5e6;
}

.multi-file-upload-area.drag-over {
    border-color: #FF8C00;
    background: #fff5e6;
    border-style: solid;
}

.upload-icon-small {
    display: block;
    margin: 0 auto 15px;
    color: #FF8C00;
}

.upload-text-small {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.upload-subtext-small {
    font-size: 12px;
    color: #999;
}

.location-category-file-input {
    display: none;
}

.category-file-previews {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.file-preview-item-enhanced {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.file-preview-item-enhanced:hover {
    background: #f8f9fa;
    border-color: #FF8C00;
    transform: translateX(5px);
}

.file-icon {
    font-size: 28px;
    min-width: 35px;
    text-align: center;
}

.file-info-enhanced {
    flex: 1;
}

.file-name-enhanced {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-size-enhanced {
    font-size: 12px;
    color: #999;
}

.file-remove-btn-enhanced {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.file-remove-btn-enhanced:hover {
    background: #c82333;
    transform: scale(1.1);
}

.no-files-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* Success Modal Enhancements */
.success-note {
    font-size: 13px;
    color: #666;
    margin-top: 15px;
    font-style: italic;
}

/* Responsive Design for Enhanced Upload */
@media (max-width: 768px) {
    .location-upload-section-enhanced {
        padding: 15px;
    }
    
    .upload-category-container {
        padding: 15px;
    }
    
    .multi-file-upload-area {
        padding: 20px 15px;
    }
    
    .file-preview-item-enhanced {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-icon {
        font-size: 24px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.uploading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* File Type Specific Colors */
.file-preview-item-enhanced[data-type="pdf"] {
    border-left: 4px solid #dc3545;
}

.file-preview-item-enhanced[data-type="excel"] {
    border-left: 4px solid #28a745;
}

.file-preview-item-enhanced[data-type="image"] {
    border-left: 4px solid #007bff;
}

.file-preview-item-enhanced[data-type="csv"] {
    border-left: 4px solid #ffc107;
}
