/* Support Chat Widget - Decision Tree Style */

/* Floating Button - Position on left side to not conflict with assistant chat */
.support-widget-button {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.support-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.support-widget-button i {
    font-size: 24px;
    color: white;
}

.support-widget-button .support-close-icon {
    display: none;
}

.support-widget-button.active .support-open-icon {
    display: none;
}

.support-widget-button.active .support-close-icon {
    display: inline;
}

/* Chat Window */
.support-widget-window {
    position: fixed;
    bottom: 100px;
    left: 24px;
    width: 380px;
    max-height: 560px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: supportSlideUp 0.3s ease;
}

.support-widget-window.active {
    display: flex;
}

@keyframes supportSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.support-widget-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-widget-header .header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.support-widget-header .header-icon i {
    font-size: 20px;
}

.support-widget-header .header-text {
    flex: 1;
}

.support-widget-header .header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.support-widget-header .header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.support-widget-header .back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.support-widget-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.support-widget-header .back-btn.hidden {
    display: none;
}

/* Content Area */
.support-widget-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Breadcrumb Navigation */
.support-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 4px;
}

.support-breadcrumb .separator {
    color: #d1d5db;
}

.support-breadcrumb .crumb {
    cursor: pointer;
    color: #6366f1;
}

.support-breadcrumb .crumb:hover {
    text-decoration: underline;
}

.support-breadcrumb .crumb.current {
    color: #374151;
    cursor: default;
}

.support-breadcrumb .crumb.current:hover {
    text-decoration: none;
}

/* Options List */
.support-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-option {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-option:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    color: #6366f1;
}

.support-option .option-icon {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.support-option:hover .option-icon {
    background: rgba(99, 102, 241, 0.1);
}

.support-option .option-icon i {
    font-size: 16px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.support-option:hover .option-icon i {
    color: #6366f1;
}

.support-option .option-text {
    flex: 1;
}

.support-option .option-text .title {
    font-weight: 500;
    margin-bottom: 2px;
}

.support-option .option-text .subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.support-option .option-arrow {
    color: #d1d5db;
    transition: color 0.2s ease, transform 0.2s ease;
}

.support-option:hover .option-arrow {
    color: #6366f1;
    transform: translateX(4px);
}

/* Country Flag in Option */
.support-option .flag-emoji {
    font-size: 24px;
}

/* Answer Display */
.support-answer {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.support-answer .answer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.support-answer .answer-header i {
    color: #10b981;
    font-size: 20px;
}

.support-answer .answer-header h5 {
    margin: 0;
    font-size: 14px;
    color: #374151;
}

.support-answer .answer-content {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.support-answer .answer-content p {
    margin: 0 0 10px 0;
}

.support-answer .answer-content p:last-child {
    margin-bottom: 0;
}

.support-answer .answer-content a {
    color: #6366f1;
}

.support-answer .answer-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.support-answer .answer-actions .btn {
    font-size: 13px;
    padding: 8px 16px;
}

/* Contact Support Fixed Footer */
.support-widget-footer {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.support-contact-btn {
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.support-contact-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.support-contact-btn i {
    font-size: 16px;
}

/* Contact Form */
.support-contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.support-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.support-form-group label .required {
    color: #ef4444;
}

.support-form-group input,
.support-form-group select,
.support-form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.support-form-group input:focus,
.support-form-group select:focus,
.support-form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.support-form-group input[readonly] {
    background: #f9fafb;
    cursor: not-allowed;
}

.support-form-group textarea {
    resize: none;
    min-height: 80px;
}

.support-form-submit {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.support-form-submit:hover {
    opacity: 0.9;
}

.support-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success/Error Messages */
.support-form-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.support-form-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.support-form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.support-form-message.show {
    display: block;
}

/* Welcome Screen */
.support-welcome {
    text-align: center;
    padding: 20px 0;
}

.support-welcome .welcome-icon {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.support-welcome .welcome-icon i {
    font-size: 28px;
    color: #6366f1;
}

.support-welcome h5 {
    margin: 0 0 8px;
    color: #374151;
    font-size: 16px;
}

.support-welcome p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

/* RTL Support */
.support-widget-button.rtl {
    left: auto;
    right: 24px;
}

.support-widget-window.rtl {
    left: auto;
    right: 24px;
}

.support-widget-window.rtl .support-option .option-arrow {
    transform: rotate(180deg);
}

.support-widget-window.rtl .support-option:hover .option-arrow {
    transform: rotate(180deg) translateX(4px);
}

.support-widget-window.rtl .support-breadcrumb .separator {
    transform: rotate(180deg);
}

/* ===== Responsive - Large Tablets (991px) ===== */
@media (max-width: 991px) {
    .support-widget-window {
        width: 360px;
        max-height: 520px;
        bottom: 90px;
    }

    .support-widget-button {
        width: 56px;
        height: 56px;
        bottom: 20px;
        left: 20px;
    }

    .support-widget-button.rtl {
        left: auto;
        right: 20px;
    }

    .support-widget-header {
        padding: 14px 18px;
    }

    .support-widget-header .header-icon {
        width: 38px;
        height: 38px;
    }
}

/* ===== Responsive - Tablets/Small Laptops (768px) ===== */
@media (max-width: 768px) {
    .support-widget-window {
        width: 340px;
        max-height: 480px;
        bottom: 85px;
        left: 16px;
    }

    .support-widget-window.rtl {
        left: auto;
        right: 16px;
    }

    .support-widget-button {
        width: 54px;
        height: 54px;
        bottom: 18px;
        left: 16px;
    }

    .support-widget-button.rtl {
        left: auto;
        right: 16px;
    }

    .support-widget-button i {
        font-size: 22px;
    }

    .support-widget-header {
        padding: 12px 16px;
    }

    .support-widget-header .header-icon {
        width: 36px;
        height: 36px;
    }

    .support-widget-header .header-icon i {
        font-size: 18px;
    }

    .support-widget-header .header-text h4 {
        font-size: 15px;
    }

    .support-widget-header .header-text p {
        font-size: 11px;
    }

    .support-widget-content {
        padding: 14px;
        gap: 10px;
    }

    .support-option {
        padding: 12px 14px;
        gap: 10px;
    }

    .support-option .option-icon {
        width: 34px;
        height: 34px;
    }

    .support-option .option-icon i {
        font-size: 15px;
    }

    .support-option .option-text .title {
        font-size: 13px;
    }

    .support-option .option-text .subtitle {
        font-size: 11px;
    }

    .support-option .flag-emoji,
    .support-option .flag-emoji .twemoji {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

    .support-widget-footer {
        padding: 10px 14px;
    }

    .support-contact-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .support-welcome {
        padding: 16px 0;
    }

    .support-welcome .welcome-icon {
        width: 54px;
        height: 54px;
        margin-bottom: 14px;
    }

    .support-welcome .welcome-icon i {
        font-size: 26px;
    }

    .support-welcome h5 {
        font-size: 15px;
    }

    .support-welcome p {
        font-size: 12px;
    }
}

/* ===== Responsive - Mobile Phones (480px) ===== */
@media (max-width: 480px) {
    .support-widget-window {
        position: fixed;
        top: 10px;
        bottom: auto;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 90px);
        max-height: calc(100dvh - 90px);
        border-radius: 12px;
    }

    .support-widget-window.rtl {
        left: 10px;
        right: 10px;
    }

    .support-widget-button {
        left: 14px;
        bottom: 14px;
        width: 50px;
        height: 50px;
    }

    .support-widget-button.rtl {
        left: auto;
        right: 14px;
    }

    .support-widget-button i {
        font-size: 20px;
    }

    /* Ensure content area is scrollable on mobile */
    .support-widget-content {
        max-height: calc(100vh - 200px);
        max-height: calc(100dvh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        gap: 8px;
    }

    /* Smaller header on mobile */
    .support-widget-header {
        padding: 10px 14px;
        gap: 10px;
    }

    .support-widget-header .header-icon {
        width: 32px;
        height: 32px;
    }

    .support-widget-header .header-icon i {
        font-size: 16px;
    }

    .support-widget-header .header-text h4 {
        font-size: 14px;
    }

    .support-widget-header .header-text p {
        font-size: 10px;
    }

    .support-widget-header .back-btn {
        width: 28px;
        height: 28px;
    }

    /* Smaller footer on mobile */
    .support-widget-footer {
        padding: 8px 12px;
    }

    .support-contact-btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Smaller options on mobile */
    .support-option {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 10px;
    }

    .support-option .option-icon {
        width: 30px;
        height: 30px;
        border-radius: 6px;
    }

    .support-option .option-icon i {
        font-size: 13px;
    }

    .support-option .option-text .title {
        font-size: 12px;
    }

    .support-option .option-text .subtitle {
        font-size: 10px;
    }

    .support-option .flag-emoji,
    .support-option .flag-emoji .twemoji {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }

    .support-option .option-arrow {
        font-size: 12px;
    }

    /* Smaller welcome section */
    .support-welcome {
        padding: 10px 0;
    }

    .support-welcome .welcome-icon {
        width: 46px;
        height: 46px;
        margin-bottom: 10px;
    }

    .support-welcome .welcome-icon i {
        font-size: 22px;
    }

    .support-welcome h5 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .support-welcome p {
        font-size: 11px;
    }

    /* Breadcrumb adjustments */
    .support-breadcrumb {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }

    /* Answer section */
    .support-answer {
        padding: 12px;
        border-radius: 10px;
    }

    .support-answer .answer-header {
        margin-bottom: 10px;
        padding-bottom: 10px;
        gap: 8px;
    }

    .support-answer .answer-header i {
        font-size: 16px;
    }

    .support-answer .answer-header h5 {
        font-size: 13px;
    }

    .support-answer .answer-content {
        font-size: 12px;
        line-height: 1.5;
    }

    .support-answer .answer-actions {
        margin-top: 12px;
        padding-top: 10px;
    }

    .support-answer .answer-actions .btn {
        font-size: 11px;
        padding: 6px 12px;
    }

    /* Form adjustments */
    .support-form-group {
        gap: 3px;
    }

    .support-form-group label {
        font-size: 12px;
    }

    .support-form-group input,
    .support-form-group select,
    .support-form-group textarea {
        padding: 8px 10px;
        font-size: 16px; /* Prevent iOS zoom on focus */
        border-radius: 6px;
    }

    .support-form-group textarea {
        min-height: 50px;
    }

    .support-form-submit {
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
    }

    .support-form-message {
        padding: 10px;
        font-size: 12px;
    }

    .support-contact-form {
        gap: 10px;
    }
}

/* ===== Responsive - Small Mobile Phones (360px) ===== */
@media (max-width: 360px) {
    .support-widget-window {
        top: 5px;
        left: 5px;
        right: 5px;
        max-height: calc(100vh - 75px);
        max-height: calc(100dvh - 75px);
        border-radius: 10px;
    }

    .support-widget-button {
        left: 10px;
        bottom: 10px;
        width: 46px;
        height: 46px;
    }

    .support-widget-button.rtl {
        left: auto;
        right: 10px;
    }

    .support-widget-button i {
        font-size: 18px;
    }

    .support-widget-content {
        padding: 10px;
        gap: 6px;
    }

    .support-widget-header {
        padding: 8px 12px;
    }

    .support-option {
        padding: 8px 10px;
    }

    .support-option .option-icon {
        width: 26px;
        height: 26px;
    }

    .support-option .option-text .title {
        font-size: 11px;
    }

    .support-welcome .welcome-icon {
        width: 40px;
        height: 40px;
    }

    .support-welcome .welcome-icon i {
        font-size: 18px;
    }

    .support-welcome h5 {
        font-size: 13px;
    }
}

/* Animation for option items */
.support-option {
    animation: fadeInUp 0.3s ease;
    animation-fill-mode: both;
}

.support-option:nth-child(1) { animation-delay: 0.05s; }
.support-option:nth-child(2) { animation-delay: 0.1s; }
.support-option:nth-child(3) { animation-delay: 0.15s; }
.support-option:nth-child(4) { animation-delay: 0.2s; }
.support-option:nth-child(5) { animation-delay: 0.25s; }
.support-option:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
