/* 
 * Mobile Iframe Specific Styles
 * Handles proper display of the estimate form when embedded in an iframe
 */

/* Base iframe container styling */
body.iframe-mode {
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main container fixes */
.iframe-mode .estimate-container {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 1rem;
    background: white;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Progress and step indicator fixes */
.iframe-mode .progress-container {
    margin-bottom: 1.5rem;
}

.iframe-mode .progress-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.iframe-mode .progress-fill {
    height: 100%;
    background-color: var(--primary-color, #4a6cf7);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.iframe-mode .step-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.iframe-mode .step {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
    line-height: 1;
}

.iframe-mode .step.active {
    background-color: var(--primary-color, #4a6cf7);
    color: white;
}

.iframe-mode .step.completed {
    background-color: #28a745;
    color: white;
}

/* Form step styling */
.iframe-mode .form-step {
    text-align: center;
}

.iframe-mode .form-step h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #212529;
    font-weight: 700;
    text-align: center;
}

.iframe-mode .step-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    text-align: center;
}

/* Form elements */
.iframe-mode .form-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.iframe-mode .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #212529;
    text-align: left;
}

.iframe-mode .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #fff;
    box-sizing: border-box;
}

.iframe-mode .form-control:focus {
    border-color: var(--primary-color, #4a6cf7);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.25);
    outline: none;
    background-color: #fff;
}

/* Navigation buttons */
.iframe-mode .form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.iframe-mode .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.iframe-mode .btn-primary {
    background-color: var(--primary-color, #4a6cf7);
    color: white;
}

.iframe-mode .btn-primary:hover {
    background-color: var(--primary-color, #3a5bd4);
    transform: translateY(-2px);
}

.iframe-mode .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.iframe-mode .btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* Media upload styling */
.iframe-mode .media-upload-container {
    margin-top: 1rem;
}

.iframe-mode .media-upload-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.iframe-mode .media-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.iframe-mode .media-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: #f8f9fa;
    transition: transform 0.2s ease;
    height: 140px;
}

/* Radio and checkbox styling */
.iframe-mode .radio-group,
.iframe-mode .checkbox-group {
    padding: 0.5rem 0;
}

.iframe-mode .radio-item,
.iframe-mode .checkbox-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.iframe-mode .radio-item input[type="radio"],
.iframe-mode .checkbox-item input[type="checkbox"] {
    margin-top: 0.25rem;
    margin-right: 0.5rem;
}

.iframe-mode .radio-item label,
.iframe-mode .checkbox-item label {
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.5;
}

/* Error message styling */
.iframe-mode .error-message {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
    font-weight: 500;
    min-height: 18px;
    clear: both;
    padding: 4px 0;
}

.iframe-mode .form-control.is-invalid {
    border-color: #dc3545;
}

.iframe-mode .form-control.is-valid {
    border-color: #198754;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .iframe-mode .estimate-container {
        padding: 0.75rem;
    }
    
    .iframe-mode .step {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    .iframe-mode .step-indicators {
        gap: 0.875rem;
    }
    
    .iframe-mode .form-step h2 {
        font-size: 1.35rem;
    }
    
    .iframe-mode .media-upload-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .iframe-mode .estimate-container {
        padding: 0.5rem;
    }
    
    .iframe-mode .step {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .iframe-mode .step-indicators {
        gap: 0.75rem;
    }
    
    .iframe-mode .form-step h2 {
        font-size: 1.25rem;
    }
    
    .iframe-mode .form-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .iframe-mode .btn {
        width: 100%;
        padding: 0.625rem 1.25rem;
    }
    
    .iframe-mode .media-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .iframe-mode .media-preview-item {
        height: 120px;
    }
}

/* Fix for very small screens */
@media (max-width: 400px) {
    .iframe-mode .estimate-container {
        padding: 0.25rem;
    }
    
    .iframe-mode .step {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .iframe-mode .step-indicators {
        gap: 0.5rem;
    }
    
    .iframe-mode .form-step h2 {
        font-size: 1.125rem;
    }
    
    .iframe-mode .step-description {
        font-size: 0.875rem;
    }
    
    .iframe-mode .form-control {
        padding: 0.625rem 0.75rem;
        font-size: 0.95rem;
    }
} 