/**
 * File: /Users/mymac/Documents/vault_module/Amdepot/WP/plugin/ffl-manager/public/css/ffl-public.css
 * Plugin: FFL Manager for WooCommerce
 * Version: 3.6.0
 * Created: 2025-09-09
 * Timestamp: 2025-12-01T12:30:00-05:00
 * Author: Linden Alley
 * Description: UX improvements - inline search form, intelligent background, 2-column mobile grid
 */

/* =========================================================
   ALL STYLES SCOPED UNDER .ffl-dealer-widget
   ZERO layout interference - no margin, padding, width, etc.
   ========================================================= */

/* =========================================================
   FFL Transfer Required Notice - Essential Styling Only
   ========================================================= */

/* FFL Notice - Alert Style for Compliance Message */
.ffl-dealer-widget .ffl-notice {
    background: #fff4e5;
    border-left: 4px solid #ff9800;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ffl-dealer-widget .ffl-notice .ffl-icon {
    font-size: 20px;
    flex-shrink: 0;
    color: #ff9800;
}

/* =========================================================
   Minimal FFL Widget Styling - Uses Theme Classes
   ========================================================= */

/* Widget root - ZERO custom styling to avoid theme conflicts */
.ffl-dealer-widget {
    /* Removed margin-bottom - let theme handle all spacing */
}

/* Search Section - Intelligent Background Container */
.ffl-dealer-widget .ffl-search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 25px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* Search Form - Inline Layout for Desktop */
.ffl-dealer-widget .ffl-search-form {
    margin-bottom: 15px !important;
}

/* Desktop: Inline search inputs + button */
.ffl-dealer-widget .ffl-search-inputs {
    display: grid !important;
    grid-template-columns: 2fr 1fr auto !important;
    gap: 10px !important;
    align-items: end !important;
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
    .ffl-dealer-widget .ffl-search-inputs {
        grid-template-columns: 1fr !important;
    }
}

/* Buttons inherit theme styles completely */
.ffl-dealer-widget #ffl-search-button,
.ffl-dealer-widget #ffl-manual-entry-button,
.ffl-dealer-widget #ffl-manual-submit,
.ffl-dealer-widget #ffl-manual-cancel,
.ffl-dealer-widget .ffl-select-dealer,
.ffl-dealer-widget .ffl-change-dealer {
    /* Zero custom styles - pure theme inheritance */
}

/* Loading indicator */
.ffl-dealer-widget .ffl-search-loader {
    text-align: center;
    padding: 20px 0;
}

/* =========================================================
   Dealer Display - Minimal Structure Only
   ========================================================= */

/* Dealer list basic structure */
.ffl-dealer-widget .ffl-dealers-list {
    display: grid;
    gap: 0;
}

/* Desktop: 3 columns */
@media (min-width: 992px) {
    .ffl-dealer-widget .ffl-dealers-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
    }
}

/* Tablet/Mobile: 2 columns */
@media (min-width: 576px) and (max-width: 991px) {
    .ffl-dealer-widget .ffl-dealers-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }
}

/* Small mobile: 1 column */
@media (max-width: 575px) {
    .ffl-dealer-widget .ffl-dealers-list {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Dealer card - bottom border only for separation */
.ffl-dealer-widget .ffl-dealer-card {
    position: relative;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 0;
    margin-bottom: 0;
}

/* Selected dealer indicator */
.ffl-dealer-widget .ffl-selected-dealer {
    position: relative;
}

.ffl-dealer-widget .ffl-selected-dealer::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #46b450;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Distance badge - separate line below dealer name */
.ffl-dealer-widget .dealer-distance-badge {
    color: #0073aa;
    font-weight: 600;
    font-size: 0.9em;
    display: block;
    margin-top: 5px;
    margin-bottom: 8px;
}

/* =========================================================
   Map Container - Minimal
   ========================================================= */

.ffl-dealer-widget .ffl-dealers-map {
    width: 100%;
    height: 400px;
}

.ffl-dealer-widget .map-info-window {
    max-width: 250px;
}

/* =========================================================
   Form Fields - Reset Theme Interference
   ========================================================= */

/* Reset YooTheme and other theme form styling */
.ffl-dealer-widget input[type="text"],
.ffl-dealer-widget input[type="tel"],
.ffl-dealer-widget input[type="email"],
.ffl-dealer-widget select {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #fff !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease !important;
}

.ffl-dealer-widget input[type="text"]:focus,
.ffl-dealer-widget input[type="tel"]:focus,
.ffl-dealer-widget input[type="email"]:focus,
.ffl-dealer-widget select:focus {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2) !important;
}

/* Remove any dotted borders or outlines from YooTheme */
.ffl-dealer-widget input,
.ffl-dealer-widget select,
.ffl-dealer-widget textarea,
.ffl-dealer-widget button {
    outline: none !important;
    outline-offset: 0 !important;
}

.ffl-dealer-widget input::-moz-focus-inner,
.ffl-dealer-widget select::-moz-focus-inner,
.ffl-dealer-widget button::-moz-focus-inner {
    border: 0 !important;
}

/* Form labels */
.ffl-dealer-widget label {
    display: block !important;
    margin-bottom: 5px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    color: #333 !important;
}

/* Form rows */
.ffl-dealer-widget .ffl-form-row {
    margin-bottom: 15px !important;
}

.ffl-dealer-widget #ffl-manual-form {
    display: none;
    background: #f9f9f9 !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 4px !important;
    padding: 20px !important;
    margin-top: 15px !important;
}

.ffl-dealer-widget .ffl-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .ffl-dealer-widget .ffl-form-row-half {
        grid-template-columns: 1fr;
    }
}

/* Form action buttons */
.ffl-dealer-widget .ffl-form-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 20px !important;
}

.ffl-dealer-widget .ffl-form-actions button {
    padding: 10px 20px !important;
    border-radius: 4px !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

/* Manual entry toggle link */
.ffl-dealer-widget #ffl-manual-entry-toggle {
    color: #0073aa !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}

.ffl-dealer-widget #ffl-manual-entry-toggle:hover {
    color: #005a87 !important;
}

/* Close button for manual form */
.ffl-dealer-widget .ffl-manual-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent !important;
    border: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
}

.ffl-dealer-widget .ffl-manual-close:hover {
    color: #000 !important;
}

/* Required field indicator */
.ffl-dealer-widget .ffl-required {
    color: #dc3232;
}

/* =========================================================
   View Switcher - Minimal
   ========================================================= */

.ffl-dealer-widget .ffl-view-switcher {
    display: flex;
    gap: 5px;
}

.ffl-dealer-widget .ffl-view-switcher button.active {
    opacity: 1;
}

.ffl-dealer-widget .ffl-view-switcher button:not(.active) {
    opacity: 0.6;
}

/* =========================================================
   Pagination Controls
   ========================================================= */

.ffl-dealer-widget .ffl-pagination-controls {
    grid-column: 1 / -1; /* Span all columns in grid */
    clear: both;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.ffl-dealer-widget .ffl-show-more-dealers {
    display: inline-block;
    background-color: #2d5f2e !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.ffl-dealer-widget .ffl-show-more-dealers:hover {
    background-color: #1f4320 !important;
}

/* =========================================================
   Responsive Utilities
   ========================================================= */

@media (max-width: 768px) {
    .ffl-dealer-widget .ffl-search-results.list-view .ffl-map-container {
        display: none;
    }
}

/* =========================================================
   Print Styles
   ========================================================= */

@media print {
    .ffl-dealer-widget .ffl-search-form,
    .ffl-dealer-widget .ffl-change-dealer,
    .ffl-dealer-widget #ffl-manual-entry-button,
    .ffl-dealer-widget .ffl-view-switcher {
        display: none;
    }
    
    .ffl-dealer-widget .ffl-dealer-card {
        break-inside: avoid;
    }
}
