/**
 * Wellsprings Blue Pool Reviews - Styles
 * Google-inspired clean and minimal design
 * Optimized for mobile and older browsers
 */

:root {
    --wb-deep-blue: #1B5B8A;
    --wb-ocean-blue: #2171A5;
    --wb-bright-cyan: #00B4D8;
    --wb-light-blue: #48CAE4;
    --wb-sky-blue: #90E0EF;
    --wb-gray-dark: #4B5563;
    --wb-gray-mid: #6B7280;
    --wb-gray-light: #9CA3AF;
    --wb-white: #FFFFFF;
    --wb-background: #F8FAFC;
    --wb-star-filled: #FBBC04;
    --wb-star-empty: #E8EAED;
    --wb-shadow: rgba(0, 0, 0, 0.1);
    --wb-shadow-hover: rgba(0, 0, 0, 0.15);
    --wb-card-border: #3db9f8;
}

/* Reset and Base Styles */
.wspr-reviews-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--wb-background);
    color: var(--wb-gray-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.wspr-reviews-page * {
    box-sizing: border-box;
}

/* Container - Full viewport with safe areas for notched phones */
.wspr-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 20px;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

/* Card - User's custom border added */
.wspr-card {
    background: var(--wb-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--wb-shadow);
    max-width: 500px;
    width: 100%;
    padding: 40px 32px;
    border: solid 3px var(--wb-card-border);
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}

/* Simple fade-in animation */
@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Logo */
.wspr-logo {
    text-align: center;
    margin-bottom: 32px;
}

/* User's custom logo box - white background */
.wspr-logo-box {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    background: #ffffff !important;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--wb-shadow);
    min-height: 60px;
}

.wspr-logo-image {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
}

/* Company Name */
.wspr-company-name {
    margin: 16px 0 0 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--wb-deep-blue);
    letter-spacing: -0.3px;
}

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

.wspr-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--wb-gray-dark);
    margin: 0 0 24px 0;
}

/* Stars Container */
.wspr-stars-container {
    margin-bottom: 32px;
}

.wspr-stars {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Fallback for browsers without gap support */
.wspr-stars .wspr-star {
    margin: 0 4px;
}

.wspr-star {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.2s ease;
    transition: -webkit-transform 0.2s ease;
    transition: transform 0.2s ease;
    transition: transform 0.2s ease, -webkit-transform 0.2s ease;
    color: var(--wb-star-empty);
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    /* Minimum touch target for accessibility */
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.wspr-star:hover {
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
}

.wspr-star:focus {
    outline: 2px solid var(--wb-bright-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}

.wspr-star.active,
.wspr-star.hovered {
    color: var(--wb-star-filled);
}

.wspr-star-svg {
    width: 40px;
    height: 40px;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.wspr-stars-hint {
    font-size: 14px;
    color: var(--wb-gray-mid);
    margin: 0;
}

/* Form Container */
.wspr-form-container {
    margin-top: 32px;
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.wspr-review-form {
    text-align: left;
}

.wspr-form-group {
    margin-bottom: 24px;
}

/* Textarea - 16px font prevents iOS zoom */
.wspr-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--wb-gray-light);
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px; /* Prevents iOS zoom on focus */
    color: var(--wb-gray-dark);
    background: var(--wb-white);
    resize: vertical;
    -webkit-transition: border-color 0.2s ease, box-shadow 0.2s ease;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.wspr-textarea:focus {
    outline: none;
    border-color: var(--wb-bright-cyan);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.wspr-textarea::-webkit-input-placeholder {
    color: var(--wb-gray-light);
}

.wspr-textarea::-moz-placeholder {
    color: var(--wb-gray-light);
}

.wspr-textarea:-ms-input-placeholder {
    color: var(--wb-gray-light);
}

.wspr-textarea::placeholder {
    color: var(--wb-gray-light);
}

/* File Upload */
.wspr-file-input {
    display: none;
}

.wspr-upload-label {
    display: block;
    cursor: pointer;
}

.wspr-upload-area {
    border: 2px dashed var(--wb-gray-light);
    border-radius: 4px;
    padding: 32px 16px;
    text-align: center;
    background: var(--wb-background);
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.wspr-upload-area:hover,
.wspr-upload-area:active {
    border-color: var(--wb-bright-cyan);
    background: rgba(0, 180, 216, 0.05);
}

.wspr-upload-icon {
    width: 32px;
    height: 32px;
    color: var(--wb-gray-mid);
    margin: 0 auto 12px;
    display: block;
}

.wspr-upload-text {
    display: block;
    font-size: 14px;
    color: var(--wb-gray-dark);
    margin-bottom: 4px;
    font-weight: 500;
}

.wspr-upload-hint {
    display: block;
    font-size: 12px;
    color: var(--wb-gray-light);
}

/* Image Previews */
.wspr-image-previews {
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.wspr-image-preview {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio */
    border-radius: 4px;
    overflow: hidden;
    background: var(--wb-background);
}

.wspr-image-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.wspr-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--wb-white);
    border: none;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    -webkit-transition: background 0.2s ease;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* Minimum touch target */
    min-width: 44px;
    min-height: 44px;
    margin: -8px -8px 0 0;
}

.wspr-image-remove:hover,
.wspr-image-remove:active {
    background: rgba(0, 0, 0, 0.8);
}

/* Submit Button */
.wspr-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--wb-deep-blue);
    color: var(--wb-white);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    -webkit-transition: background 0.2s ease, box-shadow 0.2s ease;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Minimum touch target */
    min-height: 48px;
}

.wspr-submit-btn:hover:not(:disabled),
.wspr-submit-btn:active:not(:disabled) {
    background: var(--wb-ocean-blue);
    box-shadow: 0 2px 8px var(--wb-shadow);
}

.wspr-submit-btn:active:not(:disabled) {
    -webkit-transform: translateY(1px);
    -ms-transform: translateY(1px);
    transform: translateY(1px);
}

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

.wspr-submit-spinner {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.wspr-spinner {
    width: 20px;
    height: 20px;
    color: var(--wb-white);
}

/* Success State - Takes over entire card */
.wspr-success-state {
    min-height: 300px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-animation: fadeIn 0.5s ease;
    animation: fadeIn 0.5s ease;
}

.wspr-success-content {
    text-align: center;
    width: 100%;
}

.wspr-success-logo {
    margin-bottom: 32px;
    display: inline-block;
}

/* User's custom success logo box - white background */
.wspr-success-logo-box {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    background: white;
    padding: 20px 32px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--wb-shadow);
    min-height: 60px;
}

.wspr-success-logo-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
}

/* Google Customer Reviews Logo */
.wspr-google-logo-container {
    display: inline-block;
    padding: 20px 24px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--wb-shadow);
    -webkit-animation: fadeIn 0.5s ease;
    animation: fadeIn 0.5s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.wspr-google-logo {
    width: 280px;
    height: 100px;
    display: block;
    max-width: 100%;
    background: #FFFFFF;
    border-radius: 4px;
}

.wspr-success-message {
    margin-top: 24px;
}

.wspr-success-text-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.wspr-success-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--wb-deep-blue);
    line-height: 1.4;
}

.wspr-success-checkmark {
    font-size: 32px;
    color: var(--wb-bright-cyan);
    font-weight: bold;
    line-height: 1;
}

.wspr-success-subtext {
    font-size: 16px;
    color: var(--wb-gray-mid);
    margin: 0;
}

/* Message */
.wspr-message {
    margin-top: 24px;
    padding: 16px;
    border-radius: 4px;
    text-align: center;
}

.wspr-message-success {
    background: rgba(0, 180, 216, 0.1);
    color: var(--wb-deep-blue);
}

.wspr-message-error {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.wspr-message-content {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 8px;
}

.wspr-message-text {
    font-size: 14px;
}

.wspr-checkmark {
    font-size: 20px;
    color: var(--wb-bright-cyan);
    font-weight: bold;
}

/* Mobile Responsive - Standard phones */
@media (max-width: 600px) {
    .wspr-container {
        padding: 16px;
        padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }
    
    .wspr-card {
        padding: 32px 20px;
        border-width: 2px;
    }
    
    .wspr-logo-box {
        padding: 8px;
    }
    
    .wspr-logo-image {
        max-width: 240px;
    }
    
    .wspr-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .wspr-star-svg {
        width: 36px;
        height: 36px;
    }
    
    .wspr-stars-container {
        margin-bottom: 24px;
    }
    
    .wspr-form-container {
        margin-top: 24px;
    }
    
    .wspr-form-group {
        margin-bottom: 20px;
    }
    
    .wspr-upload-area {
        padding: 24px 12px;
    }
    
    .wspr-image-previews {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .wspr-success-state {
        min-height: 250px;
    }
    
    .wspr-success-logo-box {
        padding: 16px 24px;
    }
    
    .wspr-success-logo-image {
        max-width: 160px;
    }
    
    .wspr-success-text {
        font-size: 18px;
    }
    
    .wspr-success-checkmark {
        font-size: 28px;
    }
    
    .wspr-success-subtext {
        font-size: 14px;
    }
    
    .wspr-google-logo {
        width: 220px;
        height: 80px;
    }
    
    .wspr-google-logo-container {
        padding: 12px;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    .wspr-container {
        padding: 12px;
    }
    
    .wspr-card {
        padding: 24px 16px;
    }
    
    .wspr-logo-image {
        max-width: 200px;
    }
    
    .wspr-title {
        font-size: 16px;
    }
    
    .wspr-star-svg {
        width: 32px;
        height: 32px;
    }
    
    .wspr-stars .wspr-star {
        margin: 0 2px;
        padding: 2px;
    }
    
    .wspr-textarea {
        padding: 10px 12px;
    }
    
    .wspr-upload-text {
        font-size: 13px;
    }
    
    .wspr-upload-hint {
        font-size: 11px;
    }
    
    .wspr-success-text {
        font-size: 16px;
    }
    
    .wspr-success-logo-image {
        max-width: 140px;
    }
}

/* Loading dots removed - no longer needed */

/* Ensure touch actions work properly on mobile */
.wspr-reviews-page {
    touch-action: manipulation;
}
