/**
 * Pruébalo YA Modal Styles
 */

/* Modal Overlay */
.amworks-vpt-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.amworks-vpt-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.amworks-vpt-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.amworks-vpt-close:hover,
.amworks-vpt-close:focus {
    color: #000;
}

/* Modal Title */
.amworks-vpt-modal h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="email"],
.form-group input[type="text"] {
    width: 96%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3B82F6;
}

.form-group .error-message {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f9f9f9;
}

.upload-area:hover {
    border-color: #3B82F6;
    background-color: #f0f7ff;
}

.upload-area.dragover {
    border-color: #3B82F6;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.upload-area svg {
    color: #666;
    margin-bottom: 15px;
}

.upload-area p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.upload-area .hint {
    font-size: 12px;
    color: #999;
}

/* Preview Container */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    background-color: #f9f9f9;
}

.image-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-preview .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.image-preview .remove-image:hover {
    background-color: #d63638;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

/* Privacy Notice */
.privacy-notice {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 10px 0;
}

.privacy-notice a {
    color: #3B82F6;
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.form-actions .button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.form-actions .button.primary {
    background-color: #3B82F6;
    color: white;
}

.form-actions .button.primary:hover {
    background-color: #2563EB;
}

.form-actions .button.secondary {
    background-color: #f1f1f1;
    color: #333;
}

.form-actions .button.secondary:hover {
    background-color: #e0e0e0;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Body Modal Open */
body.amworks-vpt-modal-open {
    overflow: hidden;
}

/* Modal Steps */
.modal-step {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Instructions Step */
.instructions-content {
    background-color: #f9fafb;
    border-left: 4px solid #3B82F6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.instructions-content ul {
    margin: 0;
    padding-left: 20px;
}

.instructions-content li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #374151;
}

.instructions-content b {
    color: #1f2937;
    font-weight: 600;
}

/* Reference Image */
.reference-image-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.reference-image-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 14px;
}

.reference-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reference-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.reference-image-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Disclaimer Step */
.disclaimer-content {
    background-color: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.disclaimer-content b {
    color: #92400e;
    font-weight: 600;
}

.disclaimer-content p {
    margin: 0;
    line-height: 1.6;
    color: #78350f;
}

.disclaimer-checkbox {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}

.disclaimer-checkbox:hover {
    border-color: #3B82F6;
}

.disclaimer-checkbox input[type="checkbox"]:checked + span {
    color: #1f2937;
    font-weight: 600;
}

/* Service Name */
.amworks-vpt-modal h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 500;
}

/* Disabled Button */
.form-actions .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-actions .button:disabled:hover {
    background-color: #3B82F6;
}

/* Responsive */
@media (max-width: 600px) {
    .amworks-vpt-modal-content {
        margin: 10px;
        padding: 20px;
        width: calc(100% - 20px);
    }

    .amworks-vpt-modal h2 {
        font-size: 20px;
    }

    .amworks-vpt-modal h3 {
        font-size: 16px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .preview-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .instructions-content {
        padding: 15px;
    }

    .disclaimer-content {
        padding: 15px;
    }

    .reference-image {
        max-height: 250px;
    }
}

/* Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    z-index: 1000000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in;
}

.lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1000001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #3B82F6;
}

/* Body Lightbox Open */
body.lightbox-open {
    overflow: hidden;
}

/* ===========================================
   Upload Options (Camera / File)
   =========================================== */
.upload-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
}

.upload-option {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f9f9f9;
}

.upload-option:hover {
    border-color: #3B82F6;
    background-color: #f0f7ff;
    transform: translateY(-2px);
}

.upload-option.dragover {
    border-color: #3B82F6;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.upload-option svg {
    color: #666;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.upload-option:hover svg {
    color: #3B82F6;
}

.upload-option span {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.upload-option .hint {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.upload-divider {
    color: #999;
    font-size: 14px;
    font-weight: 500;
    text-transform: lowercase;
}

/* Mobile: Stack vertically */
@media (max-width: 500px) {
    .upload-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .upload-divider {
        text-align: center;
        padding: 5px 0;
    }

    .upload-option {
        padding: 20px 15px;
    }
}

/* ===========================================
   Camera Modal
   =========================================== */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000001;
    display: none;
    animation: fadeIn 0.2s ease-in;
}

.camera-modal-content {
    position: relative;
    max-width: 600px;
    margin: 5% auto;
    padding: 20px;
    text-align: center;
}

.camera-close {
    position: absolute;
    top: -10px;
    right: 0;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.camera-close:hover {
    color: #3B82F6;
}

.camera-preview-container {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#camera-preview,
#captured-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
}

#camera-preview {
    transform: scaleX(-1); /* Mirror for selfie mode */
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.camera-controls .button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.camera-controls .button.primary {
    background-color: #3B82F6;
    color: white;
}

.camera-controls .button.primary:hover {
    background-color: #2563EB;
}

.camera-controls .button.secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.camera-controls .button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#camera-capture {
    padding: 15px 30px;
    font-size: 16px;
}

#camera-capture svg {
    fill: white;
}

.camera-error {
    color: #f87171;
    font-size: 14px;
    margin-top: 15px;
}

/* Mobile camera adjustments */
@media (max-width: 600px) {
    .camera-modal-content {
        margin: 2% auto;
        padding: 15px;
        max-width: 95%;
    }

    .camera-preview-container {
        min-height: 250px;
    }

    #camera-preview,
    #captured-image {
        max-height: 50vh;
    }

    .camera-controls {
        gap: 10px;
    }

    .camera-controls .button {
        padding: 10px 18px;
        font-size: 13px;
    }

    #camera-capture {
        padding: 12px 24px;
        font-size: 14px;
    }
}
