/* WooCommerce RFQ Plugin Styles - Complete Color Control System */

:root {
    --rfq-primary: #4A90E2;
    --rfq-secondary: #6B7280;
    
    /* RFQ Button Colors */
    --rfq-button-bg: #4A90E2;
    --rfq-button-text: #FFFFFF;
    --rfq-button-border: #4A90E2;
    
    /* WhatsApp Button Colors */
    --rfq-whatsapp-bg: #10B981;
    --rfq-whatsapp-text: #FFFFFF;
    --rfq-whatsapp-border: #10B981;
    
    /* Quantity Button Colors */
    --rfq-quantity-bg: #FFFFFF;
    --rfq-quantity-text: #000000;
    --rfq-quantity-border: #E5E7EB;
    
    /* Online Status Colors */
    --rfq-status-bg: #F0FDF4;
    --rfq-status-text: #6B7280;
    --rfq-status-border: #BBF7D0;
    
    /* System Colors */
    --rfq-success: #10B981;
    --rfq-error: #EF4444;
    --rfq-warning: #F59E0B;
    --rfq-info: #3B82F6;
    --rfq-light: #F9FAFB;
    --rfq-dark: #1F2937;
    --rfq-border: #E5E7EB;
    --rfq-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --rfq-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --rfq-radius: 12px;
    --rfq-radius-sm: 8px;
    --rfq-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Container */
.woo-rfq-container {
    max-width: 480px;
    margin: 24px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--rfq-secondary);
}

.rfq-form-wrapper {
    background: white;
    border-radius: var(--rfq-radius);
    box-shadow: var(--rfq-shadow-lg);
    border: 1px solid #F3F4F6;
    overflow: hidden;
}

/* Form Header */
.rfq-form-header {
    text-align: center;
    padding: 32px 32px 24px;
    background: white;
    border-bottom: 1px solid #F3F4F6;
}

.rfq-form-header h3 {
    margin: 0 0 8px 0;
    color: var(--rfq-dark);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.rfq-form-header p {
    margin: 0;
    color: var(--rfq-secondary);
    font-size: 16px;
    font-weight: 400;
}

/* Form Styles */
.woo-rfq-form {
    padding: 32px;
}

.rfq-field-group {
    margin-bottom: 24px;
}

.rfq-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--rfq-dark);
    margin-bottom: 12px;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.gear-icon {
    color: var(--rfq-secondary);
    flex-shrink: 0;
}

.rfq-input,
.rfq-select,
.rfq-textarea {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius-sm);
    font-size: 16px;
    font-weight: 400;
    transition: var(--rfq-transition);
    box-sizing: border-box;
    font-family: inherit;
    background: white;
    color: var(--rfq-dark);
    line-height: 1.5;
}

/* Remove quantity input arrows */
.rfq-input[type="number"]::-webkit-outer-spin-button,
.rfq-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rfq-input[type="number"] {
    -moz-appearance: textfield;
}

.rfq-input:focus,
.rfq-select:focus,
.rfq-textarea:focus {
    outline: none;
    border-color: var(--rfq-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    background: #FEFEFE;
}

.rfq-input::placeholder,
.rfq-textarea::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.rfq-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Select Wrapper */
.rfq-select-wrapper {
    position: relative;
}

.rfq-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
    color: var(--rfq-primary);
    font-weight: 500;
    cursor: pointer;
}

.rfq-select option {
    color: var(--rfq-dark);
    font-weight: 400;
}

/* Quantity Selector with Custom Colors */
.quantity-selector {
    display: flex;
    align-items: stretch;
    background: #F9FAFB;
    border: 1px solid var(--rfq-quantity-border);
    border-radius: var(--rfq-radius-sm);
    overflow: hidden;
    width: 160px;
}

.quantity-btn {
    background: var(--rfq-quantity-bg) !important;
    border: none;
    padding: 16px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--rfq-quantity-text) !important;
    transition: var(--rfq-transition);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    border-right: 1px solid var(--rfq-quantity-border);
}

.quantity-btn:last-child {
    border-right: none;
    border-left: 1px solid var(--rfq-quantity-border);
}

.quantity-btn:hover {
    background: var(--rfq-quantity-border) !important;
    opacity: 0.8;
}

.quantity-btn:active {
    transform: scale(0.98);
}

.quantity-input {
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    flex: 1;
    padding: 16px 8px;
    background: white;
    color: var(--rfq-dark);
    min-width: 64px;
}

.quantity-input:focus {
    outline: none;
    box-shadow: none;
    background: white;
}

/* Toggle Switch for Order Type */
.toggle-switch-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-labels {
    display: flex;
    justify-content: space-between;
}

.toggle-label {
    font-weight: 500;
    font-size: 15px;
    color: var(--rfq-secondary);
    transition: var(--rfq-transition);
}

.toggle-label.active {
    color: var(--rfq-primary);
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    width: 100%;
    height: 48px;
    background: #F3F4F6;
    border-radius: 24px;
    padding: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-slider {
    position: absolute;
    width: 50%;
    height: 40px;
    background: var(--rfq-primary);
    border-radius: 20px;
    transition: var(--rfq-transition);
    left: 4px;
    box-shadow: var(--rfq-shadow);
}

.toggle-switch input[name="order_type"]:nth-child(2):checked ~ .toggle-slider {
    transform: translateX(100%);
}

/* Submit Section */
.rfq-submit-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #F3F4F6;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rfq-buttons {
    display: flex;
    gap: 12px;
}

.rfq-submit-btn,
.rfq-whatsapp-btn {
    flex: 1;
    padding: 18px 24px;
    border: 2px solid transparent;
    border-radius: var(--rfq-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rfq-transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

/* RFQ Submit Button - Custom Colors */
.rfq-submit-btn {
    background: var(--rfq-button-bg) !important;
    color: var(--rfq-button-text) !important;
    border-color: var(--rfq-button-border) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.rfq-submit-btn *,
.rfq-submit-btn .btn-text,
.rfq-submit-btn .btn-loading {
    color: var(--rfq-button-text) !important;
}

.rfq-submit-btn svg {
    fill: var(--rfq-button-text) !important;
    stroke: var(--rfq-button-text) !important;
}

.rfq-submit-btn:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* WhatsApp Button - Custom Colors */
.rfq-whatsapp-btn {
    background: var(--rfq-whatsapp-bg) !important;
    color: var(--rfq-whatsapp-text) !important;
    border-color: var(--rfq-whatsapp-border) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.rfq-whatsapp-btn *,
.rfq-whatsapp-btn span {
    color: var(--rfq-whatsapp-text) !important;
}

.rfq-whatsapp-btn svg {
    fill: var(--rfq-whatsapp-text) !important;
    stroke: var(--rfq-whatsapp-text) !important;
}

.rfq-whatsapp-btn:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.rfq-submit-btn:disabled,
.rfq-whatsapp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rfq-submit-btn.loading .btn-text,
.rfq-whatsapp-btn.loading .btn-text {
    opacity: 0;
}

.rfq-submit-btn.loading .btn-loading,
.rfq-whatsapp-btn.loading .btn-loading {
    opacity: 1;
}

.btn-loading {
    position: absolute;
    opacity: 0;
    transition: var(--rfq-transition);
}

/* Online Status with Custom Colors */
.online-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--rfq-status-text) !important;
    font-weight: 500;
    padding: 12px;
    background: var(--rfq-status-bg) !important;
    border-radius: var(--rfq-radius-sm);
    border: 1px solid var(--rfq-status-border) !important;
}

.status-text {
    color: var(--rfq-status-text) !important;
}

.status-light {
    width: 8px;
    height: 8px;
    background: var(--rfq-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

.status-light.offline {
    background: var(--rfq-error);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

.status-light.offline + .status-text {
    color: var(--rfq-error) !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Messages */
.rfq-message {
    padding: 16px 20px;
    border-radius: var(--rfq-radius-sm);
    margin-bottom: 20px;
    display: none;
    font-weight: 500;
    font-size: 15px;
    opacity: 0;
    transform: translateY(-8px);
    transition: var(--rfq-transition);
    border: 1px solid transparent;
}

.rfq-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.rfq-message.success {
    background: #ECFDF5;
    color: #065F46;
    border-color: #BBF7D0;
}

.rfq-message.error {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

.rfq-message.info {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #DBEAFE;
}

.rfq-message.warning {
    background: #FFFBEB;
    color: #92400E;
    border-color: #FDE68A;
}

/* Multi-Step Modal */
.rfq-multistep-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--rfq-transition);
    backdrop-filter: blur(4px);
}

.rfq-multistep-modal.show {
    opacity: 1;
    visibility: visible;
}

.rfq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rfq-modal-content {
    position: relative;
    background: white;
    border-radius: var(--rfq-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(16px);
    transition: var(--rfq-transition);
}

.rfq-multistep-modal.show .rfq-modal-content {
    transform: scale(1) translateY(0);
}

/* Progress Bar */
.progress-container {
    padding: 24px 32px 0;
    background: #F9FAFB;
    border-bottom: 1px solid #F3F4F6;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 24px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    height: 2px;
    background: #E5E7EB;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E5E7EB;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: var(--rfq-transition);
}

.progress-step.active .step-circle,
.progress-step.completed .step-circle {
    background: var(--rfq-primary);
}

.step-label {
    font-size: 12px;
    color: var(--rfq-secondary);
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-step.active .step-label {
    color: var(--rfq-primary);
}

/* Modal Header */
.modal-header {
    padding: 32px 32px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.modal-header h3 {
    margin: 0;
    color: var(--rfq-dark);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--rfq-secondary);
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--rfq-transition);
}

.modal-close:hover {
    background: #F3F4F6;
    color: var(--rfq-dark);
}

/* Modal Body */
.modal-body {
    padding: 32px;
    position: relative;
    min-height: 300px;
}

.modal-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: var(--rfq-transition);
}

.modal-step.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.step-content h4 {
    margin: 0 0 8px 0;
    color: var(--rfq-dark);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.step-content p {
    margin: 0 0 24px 0;
    color: var(--rfq-secondary);
    line-height: 1.6;
    font-size: 15px;
}

/* Authentication Choice Buttons */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-choice-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--rfq-border);
    border-radius: var(--rfq-radius-sm);
    background: white;
    cursor: pointer;
    transition: var(--rfq-transition);
    text-align: left;
    width: 100%;
}

.auth-choice-btn:hover {
    border-color: var(--rfq-primary);
    background: #F8FAFC;
    box-shadow: var(--rfq-shadow);
}

.btn-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--rfq-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rfq-primary);
}

.btn-content {
    flex: 1;
}

.btn-title {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: var(--rfq-dark);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.btn-subtitle {
    display: block;
    font-size: 14px;
    color: var(--rfq-secondary);
    font-weight: 400;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.btn-back {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--rfq-border);
    background: white;
    color: var(--rfq-secondary);
    border-radius: var(--rfq-radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--rfq-transition);
    font-size: 15px;
}

.btn-back:hover {
    border-color: var(--rfq-secondary);
    background: var(--rfq-light);
    color: var(--rfq-dark);
}

.btn-next {
    flex: 2;
    padding: 14px 20px;
    border: none;
    background: var(--rfq-primary);
    color: white;
    border-radius: var(--rfq-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--rfq-transition);
    position: relative;
    font-size: 15px;
}

.btn-next:hover {
    background: #357ABD;
    box-shadow: 0 4px 12px 0 rgba(74, 144, 226, 0.15);
}

.btn-next:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-next.loading .btn-text {
    opacity: 0;
}

.btn-next.loading .btn-loading {
    opacity: 1;
}

/* OTP Input */
.otp-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 6px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.otp-actions {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin: 20px 0;
}

.link-button {
    background: none;
    border: none;
    color: var(--rfq-primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
    font-weight: 500;
    transition: var(--rfq-transition);
}

.link-button:hover {
    color: #357ABD;
    text-decoration: none;
}

/* Success Content */
.success-content {
    text-align: center;
}

.success-icon {
    margin: 0 auto 24px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--rfq-success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.15);
}

.success-details {
    background: var(--rfq-light);
    padding: 24px;
    border-radius: var(--rfq-radius-sm);
    margin: 24px 0;
    text-align: left;
    border: 1px solid #F3F4F6;
}

.success-details h5 {
    margin: 0 0 16px 0;
    color: var(--rfq-dark);
    font-weight: 600;
    font-size: 16px;
}

.success-details ul {
    margin: 0;
    padding-left: 20px;
    color: var(--rfq-secondary);
}

.success-details li {
    margin-bottom: 8px;
    font-size: 14px;
}

/* Required Field Indicator */
.required {
    color: var(--rfq-error);
    font-weight: 700;
}

/* Button Styles */
.rounded {
    border-radius: var(--rfq-radius-sm);
}

.square {
    border-radius: 4px;
}

.pill {
    border-radius: 50px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .woo-rfq-container {
        margin: 16px;
        max-width: none;
    }
    
    .rfq-form-wrapper {
        border-radius: var(--rfq-radius-sm);
        box-shadow: var(--rfq-shadow);
    }
    
    .woo-rfq-form {
        padding: 24px;
    }
    
    .rfq-form-header {
        padding: 24px;
    }
    
    .rfq-form-header h3 {
        font-size: 20px;
    }
    
    .rfq-buttons {
        flex-direction: column;
    }
    
    .rfq-submit-btn,
    .rfq-whatsapp-btn {
        flex: none;
    }
    
    .rfq-modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
        border-radius: var(--rfq-radius-sm);
    }
    
    .modal-header,
    .modal-body {
        padding: 24px;
    }
    
    .progress-container {
        padding: 20px 24px 0;
    }
    
    .auth-choice-btn {
        padding: 16px;
        gap: 12px;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-back,
    .btn-next {
        flex: none;
    }
    
    .quantity-selector {
        width: 140px;
    }
    
    .quantity-btn {
        width: 40px;
        padding: 12px;
    }
    
    .quantity-input {
        min-width: 60px;
        padding: 12px 4px;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-step.slide-in-right {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-step.slide-in-left {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body class for modal open */
body.modal-open {
    overflow: hidden;
}

/* Error State */
.woo-rfq-error {
    padding: 20px;
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-radius: var(--rfq-radius-sm);
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
}

/* Focus styles for accessibility */
.rfq-input:focus-visible,
.rfq-select:focus-visible,
.rfq-textarea:focus-visible,
.rfq-submit-btn:focus-visible,
.rfq-whatsapp-btn:focus-visible,
.btn-next:focus-visible,
.btn-back:focus-visible {
    outline: 2px solid var(--rfq-primary);
    outline-offset: 2px;
}

/* Loading spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}