/**
 * AI Helper Styles for Order Pages (Dark Theme)
 * surpriz.im - 2025
 */

/* AI Info Box - Strong selectors */
.form-card .ai-info-box,
.form-group .ai-info-box,
div.ai-info-box {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px dashed rgba(99, 102, 241, 0.5) !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    margin-top: 15px !important;
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.form-card .ai-info-box i,
.form-group .ai-info-box i,
div.ai-info-box i {
    font-size: 1.6rem !important;
    margin-top: 2px !important;
    color: #a78bfa !important;
}

.form-card .ai-info-box strong,
.form-group .ai-info-box strong,
div.ai-info-box strong {
    color: white !important;
}

.form-card .ai-info-box div,
.form-group .ai-info-box div,
div.ai-info-box>div {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* AI Helper Button - Strong selectors */
.form-card .ai-helper-btn,
.form-group .ai-helper-btn,
button.ai-helper-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 28px !important;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 14px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 14px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4) !important;
    font-family: inherit !important;
}

.form-card .ai-helper-btn:hover,
.form-group .ai-helper-btn:hover,
button.ai-helper-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5) !important;
    filter: brightness(1.1) !important;
}

.form-card .ai-helper-btn i,
.form-group .ai-helper-btn i,
button.ai-helper-btn i {
    font-size: 1.1rem !important;
    color: white !important;
}

/* AI Modal */
.ai-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ai-modal.show {
    display: flex;
}

.ai-modal-content {
    background: linear-gradient(145deg, #1e1e2e 0%, #2d2d44 100%);
    width: 100%;
    max-width: 520px;
    border-radius: 24px;
    padding: 35px;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: aiModalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes aiModalPopIn {
    from {
        transform: scale(0.85) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.ai-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.ai-modal-header .ai-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: white;
    font-size: 2rem;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.ai-modal-header h2 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
    font-weight: 600;
}

.ai-modal-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-top: 8px;
}

.ai-question-step {
    display: none;
}

.ai-question-step.active {
    display: block;
}

.ai-question-step label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 14px;
    font-size: 1rem;
}

.ai-input-group {
    margin-bottom: 10px;
}

.ai-input-group textarea {
    width: 100%;
    min-height: 90px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: white;
    resize: vertical;
    transition: all 0.2s ease;
}

.ai-input-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ai-input-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.12);
}

.ai-select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ai-select-option {
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.25s ease;
}

.ai-select-option:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.ai-select-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.2);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.ai-modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-btn-next,
.ai-btn-prev,
.ai-btn-generate {
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    flex: 1;
    border: none;
}

.ai-btn-next,
.ai-btn-generate {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
}

.ai-btn-prev {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.ai-btn-next:hover,
.ai-btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.ai-btn-prev:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* AI Loading State */
.ai-loading-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.ai-loading-overlay.active {
    display: flex;
}

.ai-loading-overlay h3 {
    font-size: 1.3rem;
    color: white;
    margin: 0 0 8px 0;
}

.ai-loading-overlay p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.ai-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: aiSpinDark 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes aiSpinDark {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ai-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.25s ease;
    font-size: 1rem;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

@media (max-width: 550px) {
    .ai-modal-content {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .ai-select-grid {
        grid-template-columns: 1fr;
    }

    .ai-modal-header .ai-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .ai-modal-header h2 {
        font-size: 1.3rem;
    }

    .ai-helper-btn {
        width: 100%;
        justify-content: center;
    }
}