/**
 * Free Ultrasound Generator Styles
 * 
 * @package BabyMaybeCentral\Features\FreeUltrasound
 */

/* Form Container */
#bmc-free-ultrasound-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.bmc-free-form {
    background: #fbf1ed;
    border-radius: 6px;
    padding: 30px;
}

/* Form Sections */
.bmc-form-section {
    margin-bottom: 30px;
    text-align: center;
}

.bmc-form-section h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.bmc-form-description {
    color: #666;
    font-size: 16px;
    margin: 0;
}

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

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

.bmc-required {
    color: #ff8c8c;
    margin-left: 4px;
}

.bmc-badge-premium {
    background: #ffd700;
    color: #333;
    font-size: 11px;
    font-weight: normal;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Form Controls */
.bmc-form-control {
    border: 1px solid #ccc;
    background-color: white;
    box-shadow: 0 1px 3px 0 #e6ebf1;
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.bmc-form-control:focus {
    outline: none;
    border-color: #ff8c8c;
    box-shadow: 0 0 0 3px rgba(255, 140, 140, 0.1);
}

.bmc-form-control:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 1;
}

.bmc-form-help {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* Design Grid */
.bmc-form-label-main {
    display: block;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.bmc-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.bmc-design-option {
    position: relative;
    cursor: pointer;
}

.bmc-design-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bmc-design-box {
    background: #f8e7e0;
    border: 2px solid #f8e7e0;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.bmc-design-option input[type="radio"]:checked + .bmc-design-box {
    background: white;
    border-color: #ff8c8c;
    box-shadow: 0 0 0 3px rgba(255, 140, 140, 0.1);
}

.bmc-design-option:hover .bmc-design-box {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.bmc-design-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.125);
}

.bmc-design-label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

/* Buttons */
.bmc-form-actions {
    margin-top: 30px;
    text-align: center;
}

.bmc-btn {
    font-weight: bold;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.bmc-btn-primary {
    background: linear-gradient(135deg, #ff8c8c 0%, #ff6b6b 100%);
    color: white;
}

.bmc-btn-primary:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 140, 0.3);
}

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

.bmc-btn-secondary:hover {
    background: #5a6268;
}

/* Terms */
.bmc-form-terms {
    margin-top: 20px;
    text-align: center;
}

.bmc-small-text {
    font-size: 13px;
    color: #666;
}

/* Modal Styles (MicroModal overrides) */
.modal {
    display: none;
}

.modal.is-open {
    display: block;
}

.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.modal__container {
    background-color: white;
    padding: 0;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal__title {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal__close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
}

.modal__close:before,
.modal__close:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #333;
}

.modal__close:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal__close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.modal__content {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal__footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading Spinner */
.bmc-loading-spinner {
    text-align: center;
    padding: 40px;
}

.bmc-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff8c8c;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Canvas Container */
.bmc-canvas-container {
    text-align: center;
}

#bmc-ultrasound-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Error Message */
.bmc-error-message {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Lazy Loading */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bmc-free-form {
        padding: 20px;
    }
    
    .bmc-design-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .bmc-btn {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .modal__container {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .bmc-design-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bmc-form-section h2 {
        font-size: 24px;
    }
}