/* AI Generation Modal Styles */
.ai-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ai-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.ai-generation-modal {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    position: relative;
}

.ai-modal-backdrop.show .ai-generation-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.ai-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    position: relative;
    overflow: hidden;
}

.ai-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.ai-modal-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.ai-modal-title i {
    font-size: 1.2em;
    opacity: 0.9;
}

.ai-modal-subtitle {
    margin: 8px 0 0 0;
    font-size: 0.95em;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.ai-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Progress Indicator */
.ai-progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 32px 0;
    background: white;
}

.ai-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 0.85em;
    font-weight: 500;
}

.ai-progress-step.active {
    color: #667eea;
}

.ai-progress-step.completed {
    color: #10b981;
}

.ai-progress-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ai-progress-step.active .ai-progress-number {
    background: #667eea;
    color: white;
}

.ai-progress-step.completed .ai-progress-number {
    background: #10b981;
    color: white;
}

.ai-progress-connector {
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 12px;
    transition: all 0.2s ease;
}

.ai-progress-step.completed + .ai-progress-connector {
    background: #10b981;
}

/* Modal Body */
.ai-modal-body {
    padding: 32px;
    max-height: 60vh;
    overflow-y: auto;
}

.ai-form-step {
    display: none;
}

.ai-form-step.active {
    display: block;
    animation: slideInRight 0.3s ease;
}

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

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

.ai-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.95em;
}

.ai-form-group .label-optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.85em;
}

.ai-form-group input,
.ai-form-group textarea,
.ai-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.ai-form-group input:focus,
.ai-form-group textarea:focus,
.ai-form-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.ai-form-group .form-help {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
}

/* Toggle Switch */
.ai-toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-toggle-switch.active {
    background: #667eea;
}

.ai-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-toggle-switch.active::after {
    transform: translateX(24px);
}

.ai-toggle-label {
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

/* Radio Group */
.ai-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.ai-radio-option {
    position: relative;
}

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

.ai-radio-option label {
    display: block;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9em;
    margin: 0;
}

.ai-radio-option input[type="radio"]:checked + label {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.ai-radio-option label:hover {
    border-color: #d1d5db;
}

/* Modal Footer */
.ai-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.ai-modal-footer .button-group {
    display: flex;
    gap: 12px;
}

.ai-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 100px;
    justify-content: center;
}

.ai-btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.ai-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.ai-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid transparent;
}

.ai-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading State */
.ai-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ai-loading-overlay.show {
    display: flex;
}

.ai-loading-content {
    text-align: center;
    max-width: 300px;
}

.ai-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.ai-loading-text {
    font-size: 1.1em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.ai-loading-subtext {
    font-size: 0.9em;
    color: #6b7280;
    line-height: 1.4;
}

/* Error State */
.ai-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.ai-error-message.show {
    display: block;
}

.ai-error-message i {
    margin-right: 8px;
}

/* Success State */
.ai-success-message {
    display: none;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    align-items: flex-start;
    gap: 8px;
}

.ai-success-message.show {
    display: flex;
}

.ai-success-message i {
    color: #28a745;
    margin-top: 2px;
    flex-shrink: 0;
}

.ai-success-message span {
    white-space: pre-line;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-generation-modal {
        width: 95%;
        margin: 20px;
        max-height: 95vh;
    }
    
    .ai-modal-header,
    .ai-modal-body,
    .ai-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .ai-radio-group {
        grid-template-columns: 1fr;
    }
    
    .ai-modal-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .ai-modal-footer .button-group {
        width: 100%;
    }
    
    .ai-btn {
        flex: 1;
    }
    
    .ai-progress-connector {
        width: 20px;
        margin: 0 8px;
    }
} 