/**
 * Frontend CSS for Beta Reviews Manager
 * THEME-MAPPED VERSION: Syncs with WordPress Global Styles & Presets.
 * Fixes specificity, browser-dependent dropdowns, and button coloring.
 * Author: Sameer Ahmad (Jadeed Solutions)
 */

/* =========================================
   1. SPECIFICITY OVERRIDE & VARIABLE MAPPING
   ========================================= */

/* We use 'body' to ensure our variables and styles crush any Elementor/Theme defaults */
body #brm-reviews-container, 
body #brm-form-container, 
body .brm-frontend-wrapper {
    /* MAPPING TO WORDPRESS THEME PRESETS */
    --brm-primary: var(--wp--preset--color--black, #1A1918) !important;       
    --brm-accent: var(--wp--preset--color--luminous-vivid-orange, #D96045) !important;        
    --brm-bg-white: var(--wp--preset--color--white, #FFFFFF) !important;
    --brm-bg-grey: var(--wp--preset--color--cyan-bluish-gray, #FDFCF6) !important;       
    --brm-border: #E8E6DF !important;        
    --brm-text: var(--wp--preset--color--black, #2D2B2A) !important;          
    --brm-gray: #73706A !important;          
    --brm-light-blue: #F5F4EE !important;    
    
    font-family: 'Inter', sans-serif !important;
    color: var(--brm-text) !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

/* Custom Text Selection to match theme orange */
body .brm-frontend-wrapper ::selection {
    background: var(--brm-accent) !important;
    color: #fff !important;
}

/* =========================================
   2. FILTERS BAR & CROSS-BROWSER SELECTS
   ========================================= */
body .brm-filters-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    margin-bottom: 50px !important;
    background: var(--brm-bg-grey) !important;
    padding: 30px !important;
    border-radius: 20px !important;
    border: 1px solid var(--border-color) !important;
    align-items: flex-end !important;
}

body .brm-filter-group label {
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--brm-primary) !important;
    margin-bottom: 10px !important;
    display: block !important;
}

/* --- THE DROPDOWN FIX (Nuking Browser Defaults) --- */
body .brm-select {
    display: block !important;
    width: 100% !important;
    padding: 14px 18px !important;
    border-radius: 12px !important;
    border: 1px solid var(--brm-border) !important;
    background-color: var(--brm-bg-white) !important;
    color: var(--brm-text) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    
    /* Strict Reset for Safari/Chrome/Firefox */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    
    /* Custom SVG Arrow synced with Theme Accent Orange */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D96045' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 18px !important;
    padding-right: 45px !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
}

/* =========================================
   3. TRUST HEADER
   ========================================= */
body .brm-trust-header {
    text-align: center !important;
    margin-bottom: 50px !important;
    padding: 40px !important;
    background: var(--brm-bg-grey) !important;
    border-radius: 30px !important;
    border: 1px solid var(--brm-border) !important;
}

body .brm-trust-header h2 {
    font-family: 'Newsreader', serif !important;
    font-size: 3.5rem !important;
    margin: 0 !important;
    color: var(--brm-primary) !important;
}

/* =========================================
   4. REVIEWS GRID & CARDS
   ========================================= */
body .brm-review-card {
    background-color: var(--brm-bg-grey) !important;
    padding: 40px !important;
    border-radius: 28px !important;
    border: 1px solid var(--brm-border) !important;
    display: flex !important;
    flex-direction: column !important;
}

/* =========================================
   5. SUBMISSION FORM & BUTTON FIXES
   ========================================= */
body .brm-form-box {
    background-color: var(--brm-bg-white) !important;
    border: 1px solid var(--brm-border) !important;
    border-radius: 32px !important;
    padding: 60px !important;
}

/* FORCE BUTTON COLORING (Stopping Elementor Pink #CC3366) */
body #brm-submit-btn,
body .am-btn-primary,
body button.am-btn-primary {
    background-color: var(--brm-primary) !important;
    color: #ffffff !important;
    padding: 18px 35px !important;
    border-radius: 14px !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-decoration: none !important;
}

body #brm-submit-btn:hover {
    background-color: #333130 !important;
    color: #ffffff !important;
}

/* File Drop Area */
body .brm-file-drop-area {
    border: 2px dashed var(--brm-border) !important;
    background-color: var(--brm-bg-grey) !important;
    border-radius: 20px !important;
    padding: 40px !important;
}

/* Visual Thumbnails inside card */
body .brm-file-preview-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 15px !important;
    width: 100% !important;
}

/* Responsive */
@media (max-width: 900px) {
    body .brm-filters-bar { padding: 20px !important; flex-direction: column !important; align-items: stretch !important; }
    body .brm-filter-group { min-width: 100% !important; }
}