/**
 * Frontend Styles for Voltflo Solar Quote Block
 */

/* Reset and Base Styles */
.voltflo-solar-quote-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.voltflo-solar-quote-wrapper * {
    box-sizing: border-box;
}

/* Card Container */
.vsq-card {
    width: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Address Input Card */
.vsq-form-wrapper {
    background: linear-gradient(135deg, #003366 0%, #00A3E0 100%);
    border-radius: 24px;
    padding: 3px;
    box-shadow: 0 20px 60px rgba(0, 51, 102, 0.3);
}

.vsq-form-content {
    background: white;
    border-radius: 22px;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.vsq-form-content::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.1) 0%, rgba(0, 163, 224, 0.1) 100%);
    pointer-events: none;
}

.vsq-form-content::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 163, 224, 0.1) 0%, rgba(0, 51, 102, 0.1) 100%);
    pointer-events: none;
}

/* Instant Quote Badge */
.vsq-instant-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #00A3E0;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

/* Title Section */
.vsq-title-section {
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.vsq-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.vsq-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Form Styles */
.vsq-address-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.vsq-input-wrapper {
    position: relative;
}

.vsq-address-input {
    width: 100%;
    height: 56px;
    padding-left: 44px;
    padding-right: 16px;
    font-size: 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    color: #1a1a1a;
    font-family: inherit;
}

.vsq-address-input:focus {
    border-color: #00A3E0;
    background: white;
}

.vsq-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.vsq-loading-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #00A3E0;
    border-radius: 50%;
    animation: vsq-spin 1s linear infinite;
}

@keyframes vsq-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Submit Button */
.vsq-submit-button {
    width: 100%;
    height: 56px;
    background: #9ca3af;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: not-allowed;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.6;
    font-family: inherit;
}

.vsq-submit-button.vsq-enabled {
    background: var(--secondary-color, #00A3E0);
    cursor: pointer;
    opacity: 1;
}

.vsq-submit-button.vsq-enabled:hover {
    background: var(--secondary-color, #00A3E0);
    color: white;
    opacity: 1;
}

.vsq-button-text {
    margin: 0;
}

.vsq-button-arrow {
    display: none;
}

/* Error and Loading Messages */
.vsq-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
    position: relative;
    z-index: 1;
}

.vsq-loading-message {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    display: none;
    position: relative;
    z-index: 1;
}

/* Property Found Card */
.vsq-property-wrapper {
    background: linear-gradient(135deg, #003366 0%, #00A3E0 100%);
    border-radius: 24px;
    padding: 3px;
    box-shadow: 0 20px 60px rgba(0, 51, 102, 0.3);
}

.vsq-property-content {
    background: white;
    border-radius: 22px;
    padding: 24px;
    position: relative;
}

.vsq-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1) !important;
    color: #374151 !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0 !important;
}

.vsq-close-btn:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #374151 !important;
    opacity: 1;
}

.vsq-property-badge-wrapper {
    display: none;
}

.vsq-property-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 51, 102, 0.1);
    border-radius: 10px;
}

.vsq-property-badge span {
    font-size: 15px;
    font-weight: 600;
    color: #003366;
}

.vsq-property-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.vsq-property-address {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

.vsq-property-image-container {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
}

.vsq-property-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: none;
}

/* Animated Map Pin */
.vsq-map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 5;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: vsq-pin-drop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
               vsq-pin-bounce 2s ease-in-out 0.6s infinite;
    display: none;
}

.vsq-map-pin.vsq-visible {
    display: block;
}

.vsq-pin-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vsq-pin-head {
    position: relative;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #003366 0%, #00A3E0 100%);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vsq-pin-head::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    animation: vsq-pin-pulse 2s ease-in-out infinite;
}

.vsq-pin-shadow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    filter: blur(4px);
    animation: vsq-shadow-pulse 2s ease-in-out infinite;
}

@keyframes vsq-pin-drop {
    0% {
        transform: translate(-50%, -300%) scale(0.5);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -90%) scale(1.1);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -105%);
    }
    100% {
        transform: translate(-50%, -100%);
        opacity: 1;
    }
}

@keyframes vsq-pin-bounce {
    0%, 100% {
        transform: translate(-50%, -100%);
    }
    50% {
        transform: translate(-50%, -110%);
    }
}

@keyframes vsq-pin-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0.9);
        opacity: 0.8;
    }
}

@keyframes vsq-shadow-pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.2;
    }
}

.vsq-property-loading {
    height: 250px;
    width: 100%;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.vsq-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #9ca3af;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: vsq-spin 1s linear infinite;
    margin-bottom: 12px;
}

.vsq-property-loading p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.vsq-continue-button {
    width: 100%;
    height: 48px;
    background: var(--secondary-color, #00A3E0);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.vsq-continue-button:hover {
    background: var(--secondary-color, #00A3E0);
    color: white;
    opacity: 1;
}

/* Quote Modal */
.vsq-quote-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vsq-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    height: 90vh;
    max-height: 800px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.vsq-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: #e5e7eb !important;
    border: none !important;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: none !important;
}

.vsq-modal-close:hover {
    background: #e5e7eb !important;
    opacity: 1;
}

.vsq-modal-close svg {
    color: #3d5a9c;
    stroke: #3d5a9c;
    width: 18px;
    height: 18px;
    display: block;
}

.vsq-quote-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.vsq-quote-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    z-index: 10;
}

.vsq-quote-loading .vsq-spinner {
    border-color: #e5e7eb;
    border-top-color: #00A3E0;
    margin-bottom: 16px;
}

.vsq-quote-loading p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .voltflo-solar-quote-wrapper {
        padding: 12px;
    }
    
    .vsq-form-content {
        padding: 24px;
    }
    
    .vsq-title {
        font-size: 24px;
    }
    
    .vsq-subtitle {
        font-size: 14px;
    }
    
    .vsq-property-content {
        padding: 20px;
    }
    
    .vsq-property-title {
        font-size: 20px;
    }
    
    .vsq-property-image {
        height: 200px;
    }
    
    .vsq-property-loading {
        height: 200px;
    }
    
    .vsq-continue-button {
        height: 44px;
        font-size: 15px;
    }
    
    .vsq-quote-modal {
        padding: 10px;
    }
    
    .vsq-modal-content {
        height: 95vh;
        border-radius: 12px;
    }
    
    .vsq-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 769px) {
    .vsq-property-image {
        height: 300px;
    }
    
    .vsq-property-loading {
        height: 300px;
    }
    
    .vsq-property-content {
        padding: 48px 48px 30px 48px;
    }
    
    .vsq-close-btn {
        top: 20px;
        right: 20px;
    }
    
    .vsq-continue-button {
        height: 56px;
    }
}

/* Google Places Autocomplete Dropdown Enhancement */
.pac-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    z-index: 9999;
}

.pac-item {
    padding: 12px 16px;
    cursor: pointer;
    border-top: 1px solid #f3f4f6;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background-color: #f9fafb;
}

.pac-item-query {
    font-size: 15px;
    color: #1a1a1a;
}

.pac-matched {
    font-weight: 600;
}
