﻿/**
 * SYA Design System - Single Source of Truth
 * Version: 2025.1
 * 
 * Theme-independent styling for complete SYA functionality
 * Eliminates all external theme dependencies
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES - DESIGN TOKENS
   ========================================================================== */

:root {
    /* Brand Colors - Single Source of Truth */
    --sya-primary: #FEDE00;      /* Yellow */
    --sya-secondary: #017CBF;    /* Blue 1 */
    --sya-accent: #96BA34;       /* Green 1 */
    --sya-success: #A6CC39;      /* Green 2 */
    --sya-info: #008AD2;         /* Blue 2 */
    --sya-warning: #FEDE00;      /* Yellow */
    --sya-danger: #dc3545;       /* Red */
    
    /* Neutral Colors */
    --sya-white: #ffffff;
    --sya-black: #000000;
    --sya-dark: #222222;         /* Very dark grey */
    --sya-light: #f8f9fa;
    --sya-muted: #686868;
    --sya-border: #dee2e6;
    
    /* Typography Scale */
    --sya-font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sya-font-family-heading: var(--sya-font-family-base);
    --sya-font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    /* Font Sizes - Responsive Scale */
    --sya-font-size-xs: 0.75rem;    /* 12px */
    --sya-font-size-sm: 0.875rem;   /* 14px */
    --sya-font-size-base: 1rem;     /* 16px */
    --sya-font-size-lg: 1.125rem;   /* 18px */
    --sya-font-size-xl: 1.25rem;    /* 20px */
    --sya-font-size-2xl: 1.5rem;    /* 24px */
    --sya-font-size-3xl: 1.875rem;  /* 30px */
    --sya-font-size-4xl: 2.25rem;   /* 36px */
    
    /* Font Weights */
    --sya-font-weight-light: 300;
    --sya-font-weight-base: 400;
    --sya-font-weight-medium: 500;
    --sya-font-weight-semibold: 600;
    --sya-font-weight-bold: 700;
    --sya-font-weight-extrabold: 800;
    --sya-font-weight-subtitle: 500;
    --sya-font-weight-title: 600;
    
    /* CTA Design Tokens */
    --sya-cta-primary-bg: #FEDE00;
    --sya-cta-primary-text: #000000;
    --sya-cta-primary-weight: 400;  /* Normal weight as shown in design system admin */
    
    --sya-cta-secondary-bg: #ffffff;    /* White background as shown in design system admin */
    --sya-cta-secondary-text: #000000;  /* Black text as shown in design system admin */
    --sya-cta-secondary-weight: 400;    /* Normal weight as shown in design system admin */
    --sya-cta-secondary-border: #e0e0e0; /* Light border for visibility on white backgrounds */
    
    --sya-cta-tertiary-bg: transparent;
    --sya-cta-tertiary-text: #017CBF;
    --sya-cta-tertiary-weight: 400;  /* Normal weight for consistency */
    
    /* Line Heights */
    --sya-line-height-tight: 1.25;
    --sya-line-height-base: 1.5;
    --sya-line-height-relaxed: 1.75;
    
    /* Spacing Scale */
    --sya-space-1: 0.25rem;  /* 4px */
    --sya-space-2: 0.5rem;   /* 8px */
    --sya-space-3: 0.75rem;  /* 12px */
    --sya-space-4: 1rem;     /* 16px */
    --sya-space-5: 1.25rem;  /* 20px */
    --sya-space-6: 1.5rem;   /* 24px */
    --sya-space-8: 2rem;     /* 32px */
    --sya-space-10: 2.5rem;  /* 40px */
    --sya-space-12: 3rem;    /* 48px */
    --sya-space-16: 4rem;    /* 64px */
    --sya-space-20: 5rem;    /* 80px */
    
    /* Border Radius */
    --sya-radius-none: 0;
    --sya-radius-sm: 0.125rem;  /* 2px */
    --sya-radius-base: 0.25rem; /* 4px */
    --sya-radius-md: 0.375rem;  /* 6px */
    --sya-radius-lg: 0.5rem;    /* 8px */
    --sya-radius-xl: 0.75rem;   /* 12px */
    --sya-radius-2xl: 1rem;     /* 16px */
    --sya-radius-full: 9999px;
    
    /* Shadows */
    --sya-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --sya-shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --sya-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --sya-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sya-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --sya-transition-fast: 150ms ease;
    --sya-transition-base: 250ms ease;
    --sya-transition-slow: 350ms ease;
}

/* ==========================================================================
   GLOBAL RESET - THEME INDEPENDENCE
   ========================================================================== */

/* Reset theme interference for SYA components */
.sya-component,
.sya-component * {
    box-sizing: border-box;
}

/* ==========================================================================
   TYPOGRAPHY SYSTEM
   ========================================================================== */

/* Typography utility classes with font weights */
.sya-text-xs { font-size: var(--sya-font-size-xs); }
.sya-text-sm { font-size: var(--sya-font-size-sm); }
.sya-text-base { font-size: var(--sya-font-size-base); font-weight: var(--sya-font-weight-base); }
.sya-text-lg { font-size: var(--sya-font-size-lg); }
.sya-text-xl { font-size: var(--sya-font-size-xl); }
.sya-text-2xl { font-size: var(--sya-font-size-2xl); }
.sya-text-3xl { font-size: var(--sya-font-size-3xl); }
.sya-text-4xl { font-size: var(--sya-font-size-4xl); }

.sya-leading-tight { line-height: var(--sya-line-height-tight); }
.sya-leading-base { line-height: var(--sya-line-height-base); }
.sya-leading-relaxed { line-height: var(--sya-line-height-relaxed); }

/* Typography semantic classes */
.sya-title { 
    font-size: var(--sya-font-size-2xl); 
    font-weight: var(--sya-font-weight-title);
    font-family: var(--sya-font-family-heading);
}

.sya-subtitle { 
    font-size: var(--sya-font-size-lg); 
    font-weight: var(--sya-font-weight-subtitle);
    font-family: var(--sya-font-family-heading);
}

.sya-body { 
    font-size: var(--sya-font-size-base); 
    font-weight: var(--sya-font-weight-base);
    font-family: var(--sya-font-family-base);
}

/* ==========================================================================
   BUTTON SYSTEM
   ========================================================================== */

.sya-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sya-font-family-base);
    font-size: var(--sya-font-size-base);
    font-weight: 500;
    line-height: var(--sya-line-height-tight);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--sya-radius-md);
    padding: var(--sya-space-2) var(--sya-space-4);
    cursor: pointer;
    transition: all var(--sya-transition-fast);
    user-select: none;
}

.sya-btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(1, 124, 191, 0.5);
}

.sya-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Variants */
.sya-btn-primary {
    background-color: var(--sya-cta-primary-bg);
    color: var(--sya-cta-primary-text);
    border-color: var(--sya-cta-primary-bg);
    font-weight: var(--sya-cta-primary-weight);
}

.sya-btn-primary:hover {
    background-color: #e5c500;
    border-color: #e5c500;
}

.sya-btn-secondary {
    background-color: var(--sya-cta-secondary-bg) !important;
    color: var(--sya-cta-secondary-text) !important;
    border: 1px solid var(--sya-cta-secondary-border) !important;  /* Use CSS variable for consistency */
    font-weight: var(--sya-cta-secondary-weight) !important;
}

.sya-btn-secondary:hover {
    background-color: #f5f5f5 !important;  /* Light gray hover for white secondary button */
    border-color: var(--sya-cta-secondary-border) !important;  /* Use consistent border color */
    color: #000000 !important;             /* Maintain black text */
}

.sya-btn-outline {
    background-color: transparent;
    color: var(--sya-secondary);
    border-color: var(--sya-secondary);
}

.sya-btn-outline:hover {
    background-color: var(--sya-secondary);
    color: var(--sya-white);
}

/* Button Sizes */
.sya-btn-sm {
    font-size: var(--sya-font-size-sm);
    padding: var(--sya-space-1) var(--sya-space-3);
}

.sya-btn-lg {
    font-size: var(--sya-font-size-lg);
    padding: var(--sya-space-3) var(--sya-space-6);
}

/* Button Auto-width - fits content */
.sya-btn-auto {
    width: auto;
    min-width: auto;
    padding: var(--sya-space-2) var(--sya-space-4);
}

.sya-btn-auto.sya-btn-sm {
    padding: var(--sya-space-1) var(--sya-space-3);
}

/* Clickable Card System */
.clickable-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Remove action button styles - no longer needed */

/* Empty State Icons */
.empty-state-icon i {
    color: var(--sya-muted) !important;
    opacity: 0.5;
}

/* Tertiary CTA - Text link style */
.sya-btn-tertiary {
    background-color: transparent;
    color: var(--sya-cta-tertiary-text);
    border: none;
    font-weight: var(--sya-cta-tertiary-weight);
    padding: var(--sya-space-1) var(--sya-space-2);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sya-btn-tertiary:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Action buttons within cards */
.car-actions,
.search-actions {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 14px; /* Based on image 3 spacing */
}

.car-actions .sya-btn-primary,
.search-actions .sya-btn-primary {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Ensure design system variables are applied with higher specificity */
    background-color: var(--sya-cta-primary-bg) !important;
    color: var(--sya-cta-primary-text) !important;
    font-weight: var(--sya-cta-primary-weight) !important;
    border-color: var(--sya-cta-primary-bg) !important;
}

.car-actions .sya-btn-secondary,
.search-actions .sya-btn-secondary {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Ensure secondary design system variables are applied with higher specificity */
    background-color: var(--sya-cta-secondary-bg) !important;
    color: var(--sya-cta-secondary-text) !important;
    font-weight: var(--sya-cta-secondary-weight) !important;
    border: 1px solid var(--sya-cta-secondary-border) !important;
}

.car-actions .sya-btn-primary:hover,
.search-actions .sya-btn-primary:hover {
    background-color: #e5c500 !important;
    border-color: #e5c500 !important;
}

.car-actions .sya-btn-secondary:hover,
.search-actions .sya-btn-secondary:hover {
    background-color: #f5f5f5 !important;
    border-color: var(--sya-cta-secondary-border) !important;
    color: #000000 !important;
}

/* ==========================================================================
   CARD SYSTEM
   ========================================================================== */

.sya-card {
    background-color: var(--sya-white);
    border: 1px solid var(--sya-border);
    border-radius: var(--sya-radius-lg);
    box-shadow: var(--sya-shadow-sm);
    overflow: hidden;
}

.sya-card-header {
    padding: var(--sya-space-4) var(--sya-space-6);
    border-bottom: 1px solid var(--sya-border);
    background-color: var(--sya-light);
}

.sya-card-body {
    padding: var(--sya-space-6);
}

.sya-card-footer {
    padding: var(--sya-space-4) var(--sya-space-6);
    border-top: 1px solid var(--sya-border);
    background-color: var(--sya-light);
}

/* ==========================================================================
   FORM SYSTEM
   ========================================================================== */

.sya-form-group {
    margin-bottom: var(--sya-space-4);
}

.sya-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--sya-space-2);
    color: var(--sya-dark);
}

.sya-input,
.sya-textarea,
.sya-select {
    width: 100%;
    padding: var(--sya-space-3);
    font-size: var(--sya-font-size-base);
    line-height: var(--sya-line-height-base);
    color: var(--sya-dark);
    background-color: var(--sya-white);
    border: 1px solid var(--sya-border);
    border-radius: var(--sya-radius-md);
    transition: border-color var(--sya-transition-fast);
}

.sya-input:focus,
.sya-textarea:focus,
.sya-select:focus {
    outline: none;
    border-color: var(--sya-secondary);
    box-shadow: 0 0 0 3px rgba(1, 124, 191, 0.1);
}

/* Ensure consistent sizing for inputs/selects */
.sya-select { box-sizing: border-box; }

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Spacing */
.sya-p-1 { padding: var(--sya-space-1); }
.sya-p-2 { padding: var(--sya-space-2); }
.sya-p-4 { padding: var(--sya-space-4); }
.sya-p-6 { padding: var(--sya-space-6); }
.sya-p-8 { padding: var(--sya-space-8); }

.sya-m-1 { margin: var(--sya-space-1); }
.sya-m-2 { margin: var(--sya-space-2); }
.sya-m-4 { margin: var(--sya-space-4); }
.sya-m-6 { margin: var(--sya-space-6); }
.sya-m-8 { margin: var(--sya-space-8); }

/* Colors */
.sya-text-primary { color: var(--sya-primary); }
.sya-text-secondary { color: var(--sya-secondary); }
.sya-text-muted { color: var(--sya-muted); }
.sya-text-white { color: var(--sya-white); }
.sya-text-black { color: var(--sya-black); }

.sya-bg-primary { background-color: var(--sya-primary); }
.sya-bg-secondary { background-color: var(--sya-secondary); }
.sya-bg-light { background-color: var(--sya-light); }
.sya-bg-white { background-color: var(--sya-white); }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (min-width: 768px) {
    :root {
        --sya-font-size-base: 1.125rem; /* 18px on larger screens */
    }
}

/* ==========================================================================
   COMPONENT-SPECIFIC OVERRIDES
   ========================================================================== */

/* Component-specific typography application */
.sya-component {
    font-family: var(--sya-font-family-base);
    font-size: var(--sya-font-size-base);
    font-weight: var(--sya-font-weight-base);
    line-height: var(--sya-line-height-base);
}

/* Homepage Content with admin-controlled typography */
.sya-homepage {
    font-family: var(--sya-font-family-base);
    font-size: var(--sya-font-size-base);
    font-weight: var(--sya-font-weight-base);
    line-height: var(--sya-line-height-relaxed);
}

.sya-homepage h1, 
h1.sya-title {
    font-size: var(--sya-font-size-2xl);
    font-weight: var(--sya-font-weight-title);
    font-family: var(--sya-font-family-heading);
    color: var(--sya-secondary);
}

.sya-homepage h2,
h2.sya-subtitle {
    font-size: var(--sya-font-size-lg);
    font-weight: var(--sya-font-weight-subtitle);
    font-family: var(--sya-font-family-heading);
    color: var(--sya-dark);
}

/* Dashboard Components */
.sya-dashboard {
    font-family: var(--sya-font-family-base);
    font-size: var(--sya-font-size-base);
    font-weight: var(--sya-font-weight-base);
    line-height: var(--sya-line-height-base);
}

/* Match Result Cards */
.sya-match-card {
    border-left: 4px solid var(--sya-primary);
}

.sya-match-card.rank-1 {
    border-left-color: var(--sya-accent); /* 3-way matches */
}

.sya-match-card.rank-2 {
    border-left-color: var(--sya-secondary); /* 2-way matches */
}

/* ==========================================================================
   COLOR PALETTE ADMIN STYLES
   ========================================================================== */

/* Editable Color Labels */
.color-label-input {
    background: transparent;
    border: 1px solid transparent;
    padding: 2px 4px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    border-radius: 3px;
    width: 100%;
    max-width: 120px;
    transition: all 0.2s ease;
}

.color-label-input:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

.color-label-input:focus {
    background: #ffffff;
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Color Control Wrapper Enhancements */
.color-control-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.color-chip-editable {
    margin-bottom: 16px;
}

/* Color Palette Grid */
.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

/* ==========================================================================
   ADMIN TABLE COMPONENTS - Dashboard Widgets
   ========================================================================== */

.sya-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--sya-font-family-base);
    font-size: var(--sya-font-size-sm);
    background: var(--sya-white);
    border-radius: var(--sya-radius-md);
    overflow: hidden;
    box-shadow: var(--sya-shadow-sm);
}

.sya-admin-table thead {
    background-color: var(--sya-light);
}

.sya-admin-table th {
    padding: var(--sya-space-2);
    border: 1px solid var(--sya-border);
    text-align: left;
    font-weight: var(--sya-font-weight-semibold);
    color: var(--sya-dark);
    background-color: var(--sya-light);
}

.sya-admin-table th.text-center {
    text-align: center;
}

.sya-admin-table td {
    padding: var(--sya-space-2);
    border: 1px solid var(--sya-border);
    color: var(--sya-dark);
}

.sya-admin-table td.text-center {
    text-align: center;
}

.sya-admin-table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.sya-admin-table tbody tr:hover {
    background-color: rgba(1, 124, 191, 0.05);
}

/* ==========================================================================
   MESSAGE COMPONENTS - Success/Error/Warning
   ========================================================================== */

.sya-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: var(--sya-space-4);
    border-radius: var(--sya-radius-md);
    font-family: var(--sya-font-family-base);
    font-size: var(--sya-font-size-base);
    font-weight: var(--sya-font-weight-medium);
    box-shadow: var(--sya-shadow-md);
    max-width: 500px;
    text-align: center;
}

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

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

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

.sya-message-close {
    margin-left: var(--sya-space-3);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-weight: var(--sya-font-weight-bold);
    font-size: 18px;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.sya-message-close:hover {
    opacity: 1;
}

/* Toast (message) close button tweaks when using design-system button */
.sya-message-close.sya-btn-icon {
    margin-left: var(--sya-space-3);
    font-size: var(--sya-font-size-base);
    /* keep ghost-style, no background */
    background: transparent;
    border: none;
}

/* Ensure color inherits from toast type */
.sya-message .sya-message-close { color: inherit; }

/* Admin Widget Action Links */
.sya-admin-widget-actions {
    margin-top: var(--sya-space-4);
}

.sya-admin-widget-actions .button {
    font-weight: var(--sya-cta-primary-weight);
}

/* ==========================================================================
   CONTAINER & CARD COMPONENTS - Layout Structure
   ========================================================================== */

.sya-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: var(--sya-space-5);
}

.sya-container-centered {
    text-align: center;
}

.sya-card {
    background: var(--sya-white);
    border-radius: var(--sya-radius-xl);
    box-shadow: var(--sya-shadow-md);
    padding: var(--sya-space-5);
}

.sya-card-info {
    background: var(--sya-light);
    border-radius: var(--sya-radius-lg);
    padding: var(--sya-space-5);
}

/* Match Results Components */
.sya-match-header {
    text-align: center;
    color: var(--sya-secondary);
    margin-bottom: var(--sya-space-5);
}

.sya-match-header svg {
    margin-right: var(--sya-space-2);
    vertical-align: middle;
}

.sya-match-user-card {
    border: 1px solid var(--sya-border);
    border-radius: var(--sya-radius-lg);
    padding: var(--sya-space-4);
    margin-bottom: var(--sya-space-4);
    background: var(--sya-light);
}

.sya-match-user-card h4 {
    margin: 0 0 var(--sya-space-3) 0;
    color: var(--sya-dark);
}

.sya-match-user-card p {
    margin: 0 0 var(--sya-space-3) 0;
    color: var(--sya-muted);
}

.sya-match-user-card .sya-trade-cars-label {
    margin: 0 0 var(--sya-space-1) 0;
    font-weight: var(--sya-font-weight-semibold);
    color: var(--sya-secondary);
}

.sya-match-user-card ul {
    margin: 0;
    padding-left: var(--sya-space-5);
}

.sya-match-user-card li {
    margin-bottom: var(--sya-space-1);
}

.sya-no-cars-note {
    margin: 0;
    color: var(--sya-muted);
    font-style: italic;
}

/* Login Prompt */
.sya-login-prompt {
    padding: var(--sya-space-20) var(--sya-space-5);
    text-align: center;
    background: var(--sya-light);
    border-radius: var(--sya-radius-lg);
    margin: var(--sya-space-10) 0;
}

.sya-login-prompt p {
    font-size: var(--sya-font-size-lg);
    color: var(--sya-muted);
    margin: 0;
}

.sya-login-prompt a {
    color: var(--sya-secondary);
    text-decoration: none;
}

.sya-login-prompt a:hover {
    text-decoration: underline;
}

/* Quick Actions Layout */
.quick-nav {
    margin-bottom: var(--sya-space-6);
}

.quick-nav .action-buttons {
    display: flex;
    gap: var(--sya-space-3);
    align-items: flex-start;
    flex-wrap: wrap;
}

.quick-nav .action-buttons .sya-btn {
    width: auto;
    min-width: auto;
    flex-shrink: 0;
}

/* Form Actions Layout */
.sya-form-actions {
    display: flex;
    gap: var(--sya-space-3);
    align-items: center;
    flex-wrap: wrap;
    margin: var(--sya-space-4) 0;
}

/* In toolbars, action rows should not add extra vertical spacing */
.sya-toolbar .sya-form-actions {
    margin: 0 !important;
}

/* Offer a Car / Find a Car - Toolbar row actions sizing */
#search_selector_row .sya-form-actions .sya-btn {
    font-size: var(--sya-font-size-sm);
    padding: var(--sya-space-3) var(--sya-space-4);
}

/* Toolbar component */
.sya-toolbar {
    display: flex;
    gap: var(--sya-space-4);
    align-items: flex-end !important; /* ensure bottom-aligned regardless of theme overrides */
    flex-wrap: wrap;
    margin-bottom: var(--sya-space-3);
}
.sya-toolbar > div {
    flex: 1;
    min-width: 200px;
}
.sya-toolbar label {
    display: block;
    margin-bottom: var(--sya-space-1);
    color: #333;
    font-weight: 600;
    font-size: 14px;
}
.sya-toolbar select.sya-select {
    height: var(--sya-toolbar-control-height, 48px);
    min-height: var(--sya-toolbar-control-height, 48px);
    margin: 0 !important; /* prevent legacy bottom margins (e.g., .sya-search-select-box) */
}

/* Normalize control heights inside toolbar */
.sya-toolbar .sya-form-actions .sya-btn,
.sya-toolbar .sya-form-actions .sya-btn-icon {
    height: var(--sya-toolbar-control-height, 48px);
    min-height: var(--sya-toolbar-control-height, 48px);
}
.sya-toolbar .sya-form-actions .sya-btn-icon {
    width: var(--sya-toolbar-control-height, 48px);
    min-width: var(--sya-toolbar-control-height, 48px);
}

@media (max-width: 768px) {
    .sya-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: var(--sya-space-3);
    }
    .sya-toolbar > div:first-child { margin-bottom: var(--sya-space-3); }
    .sya-toolbar .sya-form-actions .sya-btn,
    .sya-toolbar .sya-form-actions .sya-btn-icon {
        width: 100%;
        margin-bottom: var(--sya-space-2);
    }
}

/* Offer/Find selector row hooks */
#search_selector_row { --sya-toolbar-control-height: 48px; }
#search_selector_row select.sya-select { 
    padding: 0 var(--sya-space-4) !important; 
    padding-top: 0 !important; 
    padding-bottom: 0 !important; 
    margin: 0 !important; /* ensure no gap below select in Offer toolbar */
}

/* ==========================================================================
   ADMIN OVERRIDES (migrated from admin-override.css)
   ========================================================================== */

/* Admin Override Indicator Styles */
.sya-admin-override-indicator {
    color: #ff6600;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 5px;
    padding: 3px 8px;
    background-color: #fff3e0;
    border-left: 3px solid #ff6600;
    border-radius: 3px;
    display: inline-block;
}

.sya-admin-override-indicator::before {
    content: "\1F512 "; /* ≡ƒöÆ */
    margin-right: 3px;
}

/* Contact Owner Section Styling */
.sya-contact-owner h4 { margin-bottom: 10px; color: #333; }
.sya-contact-owner .contact-info { margin-bottom: 5px; }
.sya-contact-owner .contact-email { font-weight: bold; }
.sya-contact-owner .contact-email a { color: #0073aa; text-decoration: none; }
.sya-contact-owner .contact-email a:hover { text-decoration: underline; }

/* Private Message Container */
#sya-private-message-container {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-top: 10px;
}

/* Admin Controls Styling */
.sya-admin-controls {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.sya-admin-controls h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
}

.sya-admin-delete-btn {
    background-color: #d63638;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}
.sya-admin-delete-btn:hover { background-color: #a23b3c; }
.sya-admin-delete-btn:disabled { background-color: #ccc; cursor: not-allowed; }

.sya-admin-link { color: #0073aa; text-decoration: none; font-size: 12px; margin-left: 10px; }
.sya-admin-link:hover { color: #005a87; text-decoration: underline; }

/* Photo Delete Button Improvements */
.sya-car-detail-img-container { position: relative; display: inline-block; margin: 5px; }
.sya-delete-photo-btn {
    position: absolute; top: 5px; right: 5px;
    background-color: #d63638; color: #fff; border: none; border-radius: 50%;
    width: 24px; height: 24px; cursor: pointer; font-size: 12px; line-height: 1;
    z-index: 10; transition: background-color 0.2s;
}
.sya-delete-photo-btn:hover { background-color: #a23b3c; }
.sya-delete-photo-btn:disabled { background-color: #ccc; cursor: not-allowed; }

/* Admin Photo Container */
.sya-admin-photo-container { position: relative; display: inline-block; margin: 2px; }
.sya-quick-delete-photo {
    position: absolute; top: 2px; right: 2px; background: #d63638; color: #fff;
    border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px;
    cursor: pointer; line-height: 1; transition: background-color 0.2s;
}
.sya-quick-delete-photo:hover { background-color: #a23b3c; }

.sya-quick-delete-car { color: #d63638; text-decoration: none; font-size: 12px; }
.sya-quick-delete-car:hover { color: #a23b3c; text-decoration: underline; }

@media (max-width: 768px) {
    .sya-admin-override-indicator { font-size: 0.8em; padding: 2px 6px; }
    .sya-admin-controls { padding: 10px; }
    .sya-admin-delete-btn { padding: 6px 12px; font-size: 12px; }
    .sya-delete-photo-btn { width: 20px; height: 20px; font-size: 10px; }
}

/* Icon-only button modifier */
.sya-btn-icon {
    padding: var(--sya-space-2);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important; /* never show underline on icon-only buttons */
}
.sya-btn-icon i,
.sya-btn-icon svg {
    font-size: 1.1em;
    color: currentColor;
    pointer-events: none; /* click hits the button */
}

/* Do not apply link-style underline to icon-only tertiary buttons */
.sya-btn-tertiary.sya-btn-icon,
.sya-btn-tertiary.sya-btn-icon:hover,
.sya-btn-tertiary.sya-btn-icon:focus {
    text-decoration: none !important;
}
