/**
 * Weigang Smart Contact - Frontend Styles
 *
 * @package Weigang_Smart_Contact
 */

/* ==========================================================================
   Wrapper & General Styles
   ========================================================================== */

.wg-smart-contact-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

/* ==========================================================================
   Step System
   ========================================================================== */

.wscf-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.wscf-step.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   Intent Selector
   ========================================================================== */

.wscf-intent-selector {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(20, 24, 44, 0.08);
}

.wscf-intent-header {
    text-align: center;
    margin-bottom: 30px;
}

.wscf-intent-header h3 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #111827;
}

.wscf-intent-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.wscf-intent-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.wscf-intent-btn {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wscf-intent-btn:hover {
    border-color: #3498db;
    background: #f0f9ff;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(52, 152, 219, 0.15);
}

.wscf-intent-btn:focus {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

.wscf-intent-icon {
    font-size: 42px;
    line-height: 1;
}

.wscf-intent-label {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    display: block;
}

.wscf-intent-description {
    font-size: 14px;
    color: #6b7280;
    display: block;
}

/* ==========================================================================
   Booking Redirect Step
   ========================================================================== */

.wscf-booking-redirect {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 25px rgba(20, 24, 44, 0.08);
}

.wscf-booking-content {
    text-align: center;
}

.wscf-booking-icon {
    font-size: 64px;
    color: #10b981;
    display: block;
    margin-bottom: 20px;
}

.wscf-booking-content h3 {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #111827;
}

.wscf-booking-content p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.wscf-booking-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    margin: 20px auto;
    animation: wg-spin 0.8s linear infinite;
}

.wscf-booking-alt {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 30px;
}

.wscf-booking-message-instead {
    background: none;
    border: none;
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.wscf-booking-message-instead:hover {
    color: #2563eb;
}

/* ==========================================================================
   Quote Context Step
   ========================================================================== */

.wscf-quote-context {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(20, 24, 44, 0.08);
}

.wscf-quote-intro h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #111827;
}

.wscf-quote-intro p {
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 20px 0;
}

/* ==========================================================================
   Back Button
   ========================================================================== */

.wscf-back-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.wscf-back-btn:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

.wscf-back-btn:focus {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

.wscf-back-icon {
    font-size: 16px;
    line-height: 1;
}

.wscf-back-top {
    margin-bottom: 20px;
}

.wscf-back-from-form {
    margin-bottom: 15px;
}

/* ==========================================================================
   Form Step
   ========================================================================== */

.wscf-form-step {
    /* Inherits wrapper/container styles */
}

.wg-smart-contact-form {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(20, 24, 44, 0.05);
}

.wg-smart-contact-form .wg-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.wg-smart-contact-form .wg-form-header h3 {
    margin: 0;
    font-size: 22px;
    color: #111827;
}

.wg-smart-contact-form .wg-language-toggle button {
    background: transparent;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.wg-smart-contact-form .wg-language-toggle button:hover {
    border-color: #9ca3af;
}

.wg-smart-contact-form .wg-language-toggle button.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.wg-smart-contact-form .wg-language-toggle button:focus {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

.wg-smart-contact-form textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 12px;
    resize: vertical;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.wg-smart-contact-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.wg-smart-contact-form .wg-field {
    margin-bottom: 1rem;
}

.wg-smart-contact-form .wg-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.wg-smart-contact-form .wg-field input {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.wg-smart-contact-form .wg-field input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ==========================================================================
   Suggestions Box
   ========================================================================== */

.wg-smart-contact-form .wg-suggestions {
    margin-top: 1rem;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: 15px;
}

.wg-smart-contact-form .wg-suggestions-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.wg-smart-contact-form .wg-suggestions-header strong {
    color: #1e40af;
}

.wg-smart-contact-form .wg-suggestion {
    padding: 10px 0;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}

.wg-smart-contact-form .wg-suggestion:last-child {
    border-bottom: none;
}

.wg-smart-contact-form .wg-suggestion strong {
    display: block;
    margin-bottom: 6px;
    color: #1e3a8a;
    font-size: 15px;
}

.wg-smart-contact-form .wg-suggestion p {
    margin: 0 0 8px 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.wg-smart-contact-form .wg-badge {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 999px;
    font-weight: 500;
}

/* ==========================================================================
   Booking Links & Available Slots
   ========================================================================== */

.wg-smart-contact-form .wg-answer {
    margin: 8px 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.wg-available-slots {
    margin: 10px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.wg-available-slots p {
    margin: 0 0 10px 0;
}

.wg-available-slots p strong {
    color: #1e40af;
    font-size: 14px;
}

.wg-slots-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wg-slots-list li {
    margin: 0;
}

.wg-booking-link {
    display: inline-flex;
    align-items: center;
    background: #3498db;
    color: #ffffff !important;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.wg-booking-link:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.wg-booking-link:focus {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

.wg-booking-link:active {
    transform: translateY(0);
}

/* ==========================================================================
   Service Request Detection UI
   ========================================================================== */

.wg-service-suggestion {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: wgSlideIn 0.4s ease-out;
}

.wg-service-suggestion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.wg-service-suggestion-icon {
    font-size: 28px;
    line-height: 1;
}

.wg-service-suggestion h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.wg-service-suggestion-text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.95;
}

.wg-service-ctas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wg-service-cta {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wg-service-cta:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.wg-service-cta:active {
    transform: translateY(0);
}

.wg-service-cta-icon {
    font-size: 18px;
    line-height: 1;
}

.wg-service-metadata {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    opacity: 0.9;
}

.wg-service-metadata strong {
    color: #ffffff;
    font-weight: 600;
}

.wg-service-divider {
    margin: 24px 0;
    text-align: center;
    position: relative;
}

.wg-service-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.wg-service-divider-text {
    position: relative;
    display: inline-block;
    background: #ffffff;
    padding: 0 16px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Slide in animation */
@keyframes wgSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .wg-service-suggestion {
        padding: 20px 16px;
    }

    .wg-service-ctas {
        grid-template-columns: 1fr;
    }

    .wg-service-cta {
        padding: 12px 16px;
        font-size: 14px;
    }
}

.wg-smart-contact-form .wg-helpful-buttons {
    margin-top: 12px;
    display: none;
    gap: 10px;
    flex-wrap: wrap;
}

.wg-smart-contact-form .wg-helpful-buttons button {
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wg-smart-contact-form .wg-helpful-buttons button:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-1px);
}

.wg-smart-contact-form .wg-helpful-buttons button:focus {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

/* ==========================================================================
   Contact Fields & Submit
   ========================================================================== */

.wg-smart-contact-form .wg-contact-fields {
    margin-top: 1.5rem;
}

.wg-smart-contact-form .wg-submit-button {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
}

.wg-smart-contact-form .wg-submit-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.wg-smart-contact-form .wg-submit-button:focus {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

.wg-smart-contact-form .wg-submit-button:active {
    transform: translateY(0);
}

/* ==========================================================================
   Loading & Success States
   ========================================================================== */

.wg-smart-contact-form .wg-loading {
    display: none;
    margin-top: 1rem;
    text-align: center;
    color: #6b7280;
}

.wg-smart-contact-form .wg-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    display: inline-block;
    animation: wg-spin 0.8s linear infinite;
    margin-right: 10px;
}

.wg-form-success {
    background: #d1fae5;
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #065f46;
    font-size: 18px;
    font-weight: 500;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes wg-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Fade in animation for steps */
@keyframes wgFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 768px) {
    .wscf-intent-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .wscf-intent-btn {
        padding: 25px 20px;
    }

    .wscf-intent-header h3 {
        font-size: 24px;
    }

    .wg-smart-contact-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }

    .wscf-intent-selector,
    .wscf-booking-redirect,
    .wscf-quote-context {
        padding: 25px 20px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .wg-smart-contact-form {
        padding: 15px;
    }

    .wg-smart-contact-form .wg-form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .wg-smart-contact-form .wg-form-header h3 {
        font-size: 20px;
    }

    .wg-smart-contact-form .wg-language-toggle {
        display: flex;
        width: 100%;
    }

    .wg-smart-contact-form .wg-language-toggle button {
        flex: 1;
        margin-left: 0;
        margin-right: 6px;
    }

    .wg-smart-contact-form .wg-language-toggle button:last-child {
        margin-right: 0;
    }

    .wscf-intent-selector {
        padding: 20px 15px;
    }

    .wscf-intent-header h3 {
        font-size: 22px;
    }

    .wscf-intent-header p {
        font-size: 14px;
    }

    .wscf-intent-btn {
        padding: 20px 15px;
    }

    .wscf-intent-icon {
        font-size: 36px;
    }

    .wscf-intent-label {
        font-size: 16px;
    }

    .wscf-intent-description {
        font-size: 13px;
    }

    .wscf-booking-redirect,
    .wscf-quote-context {
        padding: 20px 15px;
    }

    .wscf-booking-icon {
        font-size: 48px;
    }

    .wscf-booking-content h3 {
        font-size: 22px;
    }

    .wg-smart-contact-form .wg-submit-button {
        padding: 14px 20px;
    }
}

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

@media print {
    .wscf-back-btn,
    .wg-language-toggle,
    .wg-submit-button {
        display: none !important;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus visible for keyboard navigation */
.wscf-intent-btn:focus-visible,
.wscf-back-btn:focus-visible,
.wg-smart-contact-form button:focus-visible,
.wg-smart-contact-form input:focus-visible,
.wg-smart-contact-form textarea:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .wscf-intent-btn:hover {
        transform: none;
    }

    .wg-smart-contact-form .wg-submit-button:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wscf-intent-btn {
        border-width: 3px;
    }

    .wscf-intent-btn:hover {
        border-width: 3px;
    }

    .wg-smart-contact-form textarea,
    .wg-smart-contact-form input {
        border-width: 2px;
    }
}

/* ==========================================================================
   Keyword Action Suggestions - Simple Inline Style
   ========================================================================== */

.wg-keyword-action {
    position: relative;
    background: transparent;
    border: none;
    padding: 8px 0;
    padding-right: 24px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    animation: fadeIn 0.2s ease-out;
}

.wg-keyword-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wg-keyword-icon {
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
}

.wg-keyword-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wg-keyword-title strong {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Hide subtitle in simple mode */
.wg-keyword-subtitle {
    display: none;
}

.wg-keyword-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wg-keyword-action-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wg-keyword-action-btn:hover {
    background: #e5e5e5;
    color: #111827;
}

.wg-keyword-action-btn.primary {
    background: #e8f0fe;
    color: #1a73e8;
}

.wg-keyword-action-btn.primary:hover {
    background: #d2e3fc;
    color: #1557b0;
}

/* Hide icons in simple mode */
.wg-action-icon {
    display: none;
}

.wg-action-label {
    white-space: nowrap;
}

.wg-keyword-dismiss {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.wg-keyword-dismiss:hover {
    color: #666;
}

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

/* Mobile styles for keyword actions */
@media (max-width: 640px) {
    .wg-keyword-action {
        padding: 10px 12px;
    }

    .wg-keyword-title strong {
        font-size: 13px;
    }

    .wg-keyword-action-btn {
        font-size: 13px;
        padding: 4px 6px;
    }
}
