/**
 * FaceLift User Preferences Modal Styles
 */

/* Loading State Fix */
.facelift-loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    opacity: 0;
    animation: fadeInSlow 0.5s ease 0.3s forwards;
}

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

.facelift-prefs-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Ensure modal doesn't touch edges */
}

.facelift-prefs-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.facelift-prefs-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 32px;
    margin: auto; /* Extra centering insurance */
}

.facelift-prefs-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.facelift-prefs-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.facelift-prefs-close svg {
    width: 20px;
    height: 20px;
}

.facelift-prefs-content h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.facelift-prefs-section {
    margin: 24px 0;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.facelift-prefs-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.facelift-prefs-section h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

.facelift-prefs-description {
    margin: 0 0 16px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Presentation Options Grid */
.facelift-prefs-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.facelift-pref-option {
    cursor: pointer;
    display: block;
}

.facelift-pref-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
    position: relative;
}

.facelift-pref-option:hover .option-card {
    border-color: #FF6B35;
    transform: translateY(-1px);
}

.facelift-pref-option input[type="radio"]:checked + .option-card {
    border-color: #FF6B35;
    background: #fff5f0;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.option-icon {
    font-size: 36px;
    margin-bottom: 8px;
    line-height: 1;
}

.option-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1d2327;
}

.option-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
}

/* Email Subscription */
.facelift-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 12px;
}

.facelift-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.facelift-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 10px;
}

.facelift-radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Stage-specific options */
.facelift-stage-options {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stage-option {
    animation: slideDown 0.2s ease;
}

.facelift-option-note {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.facelift-custom-logo-field {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    animation: slideDown 0.2s ease;
}

.facelift-input-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: #9ca3af;
}

.facelift-email-field {
    margin-top: 12px;
    animation: slideDown 0.2s ease;
}

.facelift-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.facelift-input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Actions */
.facelift-prefs-actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.facelift-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.facelift-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.facelift-btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #D2691E 100%);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.facelift-btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    transform: translateY(-1px);
}

.facelift-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.facelift-btn-secondary {
    background: white;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
}

.facelift-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Message */
.facelift-prefs-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    animation: slideDown 0.2s ease;
}

.facelift-message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.facelift-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.facelift-message-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* Branding Footer */
.facelift-branding {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.facelift-branding a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #9ca3af;
    font-size: 12px;
    transition: all 0.2s;
    opacity: 0.7;
}

.facelift-branding a:hover {
    opacity: 1;
    color: #6b7280;
}

.facelift-branding img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: grayscale(1) opacity(0.6);
    transition: filter 0.2s;
}

.facelift-branding a:hover img {
    filter: grayscale(0) opacity(1);
}

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

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

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .facelift-prefs-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 60px 24px 24px;
    }
    
    .facelift-prefs-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .option-card {
        padding: 14px;
    }
    
    .option-icon {
        font-size: 32px;
    }
}
