/* Variables */
:root {
    --primary-color: #FF4F5E;
    --secondary-color: #333333;
    --text-primary: #333333;
    --text-secondary: #333333;
    --background-light: #F7F7F7;
    --border-color: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.08);
    --hover-shadow: rgba(0, 0, 0, 0.15);
    --primary-lighter: rgba(255, 140, 0, 0.1);
    --error-color: #dc2626;
    --success-color: #059669;
}

/* Base Form Styles */
form#stayonpro-form {
    max-width: 1024px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
}

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

.form-column {
    flex: 1;
}

/* Input Fields */
form#stayonpro-form input:not([type="file"]),
form#stayonpro-form textarea,
form#stayonpro-form select {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: white;
}

form#stayonpro-form input:hover:not([type="file"]),
form#stayonpro-form textarea:hover,
form#stayonpro-form select:hover {
    border-color: #d1d5db;
}

form#stayonpro-form input:focus:not([type="file"]),
form#stayonpro-form textarea:focus,
form#stayonpro-form select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-lighter);
    outline: none;
}

/* File Upload Fields */
form#stayonpro-form input[type="file"] {
    padding: 10px;
    border: 2px dashed var(--border-color);
    background-color: var(--background-light);
    cursor: pointer;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

form#stayonpro-form input[type="file"]:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-lighter);
}

/* Labels */
form#stayonpro-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Custom Select Styling */
form#stayonpro-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

/* Multi-select Styling */
form#stayonpro-form select[multiple] {
    background-image: none;
    padding-right: 15px;
    height: auto;
    min-height: 200px;
}

/* Color Picker Customization */
.wp-picker-container {
    margin-bottom: 20px;
}

.wp-picker-container .wp-color-result.button {
    height: 40px;
    border-radius: 8px;
    box-shadow: none;
}

.wp-picker-container .wp-picker-input-wrap input[type="text"] {
    height: 40px;
    border-radius: 8px;
}

/* Font Selection */
.font-selection {
    background-color: var(--background-light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* State Selection */
.state-selection {
    margin-bottom: 20px;
}

#state {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

/* Button Styles */
form#stayonpro-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

form#stayonpro-form button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

/* Error Messages */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: -15px;
    margin-bottom: 15px;
    display: none;
}

/* Autosave Notification */
.restore-notification {
    background-color: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.restore-message {
    display: flex;
    align-items: center;
    gap: 15px;
}

.restore-button, 
.clear-button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.restore-button {
    background-color: var(--success-color);
    color: white;
}

.clear-button {
    background-color: var(--error-color);
    color: white;
}

.restore-button:hover,
.clear-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Accordion Styles */
.accordion .accordion-header {
    background-color: white;
    color: var(--text-primary);
    padding: 20px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accordion .accordion-header:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

.accordion .accordion-header.active:after {
    transform: rotate(180deg);
}

.accordion .accordion-header:hover {
    background-color: var(--background-light);
}

.accordion .accordion-header.active {
    background-color: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.accordion .accordion-content {
    display: none;
    background-color: white;
    padding: 25px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.accordion .accordion-content.active {
    display: block;
}

.business-status option[value="closed"] {
    background-color: #f0f0f0;
    color: #888;
}

/* Hours */
.business-hours-container {
    background: var(--background-light);
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
  }
  
  .business-hours-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .business-day-label {
    min-width: 100px;
    font-weight: 500;
    color: var(--text-primary);
  }
  
  .business-hour-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
  }
  
  .business-hour-input select {
    flex: 1;
    max-width: 150px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
  }
  
  .business-status {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-right: 15px;
    background-color: white;
  }
  
  .business-status.status-closed {
    opacity: 0.6;
    font-style: italic;
  }
  
  form#stayonpro-form select:disabled,
  .business-hours-select:disabled {
      background-color: #f0f0f0;
      color: #888;
      cursor: not-allowed;
      opacity: 0.6;
      border-color: #ddd;
  }

  .business-hours-to {
    padding-left: 20px;
    padding-right:20px;
  }
  
  @media (max-width: 768px) {
    .business-hours-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }
  
    .business-day-label {
      min-width: auto;
    }
  
    .business-hour-input {
      flex-direction: column;
      align-items: stretch;
    }
  
    .business-hour-input select {
      max-width: none;
    }
  }

/* Gallery Upload Styles */
.gallery-upload {
    padding: 30px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    text-align: center;
    background: var(--background-light);
    margin: 20px 0;
    transition: all 0.2s ease;
}

.gallery-upload:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-lighter);
}

.gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview-container {
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

.preview-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px 0;
}

.file-name {
    font-size: 0.9em;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.remove-image {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.remove-image:hover {
    transform: scale(1.1);
    background: #b91c1c;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Media Queries */
@media (max-width: 1024px) {
    form#stayonpro-form {
        padding: 15px;
        margin: 15px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    form#stayonpro-form {
        padding: 10px;
    }

    .day-hours {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }

    .day-hours select,
    .day-hours input[type="time"] {
        width: 100%;
    }

    .restore-message {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .restore-button,
    .clear-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gallery-preview {
        grid-template-columns: 1fr;
    }

    form#stayonpro-form button {
        width: 100%;
    }

    .accordion .accordion-header {
        padding: 15px;
    }

    .accordion .accordion-content {
        padding: 15px;
    }
}

/* Listing Container */
.stayonpro-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters Section */
.stayonpro-filters {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 20px var(--shadow);
    margin-bottom: 40px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.filters-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr auto;
    gap: 16px;
    align-items: center;
}

.filters-row select,
.filters-row input {
    height: 54px;
    padding: 0 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    background-color: white;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 0;
}

.filters-row .reset-filters {
    height: 54px;
    padding: 0 24px;
    background-color: var(--background-light);
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters-row .reset-filters:hover {
    background-color: var(--border-color);
}

/* Contractors Grid */
.contractors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0;
}

.contractors-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Contractor Card */
.contractor-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: cardAppear 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.contractor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px var(--hover-shadow);
}

.contractor-card .image-link {
    display: block;
    position: relative;
    padding-top: 66.67%;
    overflow: hidden;
}

.contractor-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.contractor-card .image-link:hover img {
    transform: scale(1.05);
}

.contractor-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.contractor-card h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.4;
    color: var(--text-primary);
}

.contractor-card h3 a {
    color: inherit;
    text-decoration: none;
}

.contractor-card .description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Location Badge */
.location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 12px;
}

.location i {
    color: var(--primary-color);
}

/* Sectors Tags */
.sectors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.sector {
    background: var(--background-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sector i {
    color: var(--primary-color);
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Read More Button */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.read-more:hover {
    background: #333333;
    transform: translateY(-1px);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--primary-lighter);
    color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 20px var(--shadow);
}

.no-results i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Responsive Design for Listing */
@media (max-width: 1400px) {
    .contractors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .contractors-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stayonpro-container {
        padding: 15px;
    }

    .stayonpro-filters {
        padding: 15px;
        position: relative;
        top: 0;
    }

    .filters-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .contractors-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contractor-card {
        margin-bottom: 0;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .card-footer {
        flex-direction: column;
        gap: 10px;
    }

    .read-more {
        width: 100%;
        justify-content: center;
    }

    .sectors {
        margin: 10px 0;
    }

    .sector {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

/* Font Selection Styles */
.font-selection-section {
    background: var(--background-light);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.font-preview-container {
    margin-bottom: 25px;
}

.font-preview-select {
    font-size: 16px;
    padding: 12px;
    margin-bottom: 15px;
}

.font-preview-select option {
    padding: 8px;
    font-size: 16px;
    line-height: 1.5;
}

.font-preview {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.font-preview h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.font-preview p {
    margin: 5px 0;
}

/* Color Picker Styles */
.color-picker-section {
    background: var(--background-light);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-picker-input {
    width: 120px !important;
    text-transform: uppercase;
    text-align: center;
    font-family: monospace;
    font-size: 16px !important;
    padding: 10px !important;
}

.color-picker-visual {
    width: 100px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.color-preset {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Style formulaire non affiché si aucun abonnement */
.stayonpro-message {
    text-align: center;
}

.accordion-header.has-error {
    border-left: 3px solid red;
}

.error-message {
    color: red;
    font-size: 0.9em;
    margin-top: 5px;
    display: none;
}

/* Popup errors form */
.validation-popup {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.popup-content h3 {
    color: #FF4F5E;
    margin-bottom: 20px;
}
.popup-content ul {
    margin: 0;
    padding: 0 0 0 20px;
    margin-bottom: 20px;
}
.popup-content li {
    color: #666;
    margin-bottom: 8px;
}
.popup-content button {
    background: #FF4F5E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}
.popup-content button:hover {
    background: #FF4F5E;
}

.word-count-indicator {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    text-align: right;
}

/* Logique des sercices */
/* Services management */
.service-item {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.service-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2em;
}

.remove-service {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-service:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.services-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.add-service-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.add-service-button:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.service-counter {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Pour le champ SIRET */
#siret {
    font-family: monospace;
    letter-spacing: 0.1em;
}