/**
 * WooCommerce Quote System Styles
 * 
 * @package WooCommerce Quote System
 * @version 1.5.1
 */

/* ==========================================================================
   Quote Buttons
   ========================================================================== */

.wcqs-quote-buttons {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.wcqs-quote-btn,
.wcqs-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px 14px 50px; /* Left padding for icon */
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    line-height: 1.4;
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    color: white;
}

.wcqs-quote-btn:before,
.wcqs-whatsapp-btn:before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

.wcqs-quote-btn {
    background-color: #0073aa;
}

.wcqs-quote-btn:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.wcqs-quote-btn:hover,
.wcqs-quote-btn:focus {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.wcqs-whatsapp-btn {
    background-color: #25D366;
}

.wcqs-whatsapp-btn:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.465 3.516'/%3E%3C/svg%3E");
}

.wcqs-whatsapp-btn:hover,
.wcqs-whatsapp-btn:focus {
    background-color: #128C7E;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.wcqs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(128, 128, 128, 0.8) !important; /* Light gray background */
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

.wcqs-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: wcqs-modal-appear 0.3s ease-out;
}

@keyframes wcqs-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wcqs-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wcqs-close:hover,
.wcqs-close:focus {
    color: #333;
    background-color: #f5f5f5;
}

.wcqs-modal-header {
    margin-bottom: 25px;
    padding-right: 50px; /* Space for close button */
}

.wcqs-modal h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.wcqs-modal-subtitle {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.4;
    font-weight: 400;
}

.wcqs-form-container {
    margin-top: 0;
}

/* ==========================================================================
   Form Optimization
   ========================================================================== */

.wcqs-form-container input[type="text"],
.wcqs-form-container input[type="email"],
.wcqs-form-container textarea,
.wcqs-form-container select {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 2px solid #e1e1e1 !important;
    border-radius: 6px !important;
    font-size: 16px !important; /* Prevent iOS zoom */
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
}

.wcqs-form-container input[type="text"]:focus,
.wcqs-form-container input[type="email"]:focus,
.wcqs-form-container textarea:focus,
.wcqs-form-container select:focus {
    border-color: #0073aa !important;
    outline: none !important;
}

.wcqs-form-container input[type="submit"],
.wcqs-form-container button[type="submit"] {
    background-color: #0073aa !important;
    color: white !important;
    padding: 14px 28px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-height: 48px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.wcqs-form-container input[type="submit"]:hover,
.wcqs-form-container button[type="submit"]:hover {
    background-color: #005a87 !important;
    transform: translateY(-1px) !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet styles */
@media (max-width: 1024px) {
    .wcqs-modal {
        padding: 15px;
    }
    
    .wcqs-modal-content {
        padding: 25px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .wcqs-quote-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .wcqs-quote-btn,
    .wcqs-whatsapp-btn {
        width: 100%;
        text-align: center;
        padding: 16px 20px 16px 60px; /* Mobile icon spacing */
        font-size: 17px; /* iOS optimization */
        min-height: 50px;
    }
    
    .wcqs-quote-btn:before,
    .wcqs-whatsapp-btn:before {
        left: 20px;
        width: 22px;
        height: 22px;
    }
    
    .wcqs-modal {
        padding: 10px;
        align-items: flex-end; /* Bottom alignment for mobile */
    }
    
    .wcqs-modal-content {
        width: 100%;
        max-height: 95vh;
        padding: 25px 20px;
        border-radius: 16px 16px 0 0; /* Top rounded corners */
        margin-top: auto;
        animation: wcqs-modal-slide-up 0.3s ease-out;
    }
    
    @keyframes wcqs-modal-slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .wcqs-modal-header {
        margin-bottom: 20px;
        padding-right: 45px;
    }
    
    .wcqs-modal h3 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .wcqs-modal-subtitle {
        font-size: 14px;
    }
    
    .wcqs-close {
        top: 12px;
        right: 15px;
        font-size: 28px;
        width: 36px;
        height: 36px;
    }
    
    .wcqs-form-container {
        margin-top: 0;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .wcqs-modal-content {
        padding: 20px 15px;
    }
    
    .wcqs-modal h3 {
        font-size: 18px;
        padding-right: 40px;
    }
    
    .wcqs-close {
        font-size: 24px;
        width: 32px;
        height: 32px;
    }
    
    .wcqs-quote-btn,
    .wcqs-whatsapp-btn {
        padding: 14px 16px 14px 50px; /* Small screen icon spacing */
        font-size: 16px;
    }
    
    .wcqs-quote-btn:before,
    .wcqs-whatsapp-btn:before {
        left: 16px;
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================================
   Accessibility & User Preferences
   ========================================================================== */

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .wcqs-quote-btn,
    .wcqs-whatsapp-btn,
    .wcqs-close,
    .wcqs-modal-content {
        transition: none !important;
        animation: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wcqs-modal-content {
        background-color: #1e1e1e;
        color: #ffffff;
    }
    
    .wcqs-modal h3 {
        color: #ffffff;
    }
    
    .wcqs-modal-subtitle {
        color: #cccccc;
    }
    
    .wcqs-close {
        color: #cccccc;
    }
    
    .wcqs-close:hover,
    .wcqs-close:focus {
        color: #ffffff;
        background-color: #333333;
    }
}