// AI Loading State
.ai-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    min-height: 200px;

    .ai-loading-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;

        .loading-spinner {
            width: 24px;
            height: 24px;
            color: #007cba;

            svg {
                width: 100%;
                height: 100%;
            }
        }

        p {
            color: #666;
            font-size: 14px;
            margin: 0;
            font-weight: 500;
        }
    }
}

// Warning box for AI settings issues
.swptls-ai-settings-warning {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 6px;
    padding: 16px;
    margin: 20px 0;
    display: flex;
    align-items: center;

    .ai-warning-content {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 12px;

        .warning-icon {
            font-size: 18px;
            color: #d97706;
        }

        .warning-text {
            flex: 1;
            color: #92400e;
            font-size: 14px;
            line-height: 1.4;
        }

        .warning-link {
            color: #008717;
            text-decoration: none;
            font-weight: 500;
            font-size: 14px;
            white-space: nowrap;
            padding: 6px 12px;
            border-radius: 4px;
            background-color: rgba(52, 160, 250, 0.1);
            transition: all 0.2s ease;

            &:hover {
                background-color: rgba(52, 160, 250, 0.2);
                text-decoration: underline;
            }
        }
    }
}

// Backend AI Summary Modal Styles
.backend-summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;

    &.show {
        opacity: 1;
        visibility: visible;
    }

    .modal-content {
        background: white;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        max-width: 800px;
        width: 90%;
        max-height: 80vh;
        overflow: hidden;
        transform: scale(0.9);
        transition: transform 0.3s ease;
        position: relative;
    }

    &.show .modal-content {
        transform: scale(1);
    }

    .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 24px 30px;
        background: linear-gradient(135deg, #008717 0%, #667eea 100%);
        color: white;
        border-radius: 12px 12px 0 0;

        h3 {
            margin: 0;
            font-size: 20px;
            font-weight: 600;
            line-height: 1.2;
        }

        .close-modal {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.2s ease;

            &:hover {
                background: rgba(255, 255, 255, 0.2);
            }
        }
    }

    .modal-body {
        padding: 30px;
        max-height: 60vh;
        overflow-y: auto;

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

            &:last-child {
                margin-bottom: 0;
            }

            label {
                display: block;
                margin-bottom: 8px;
                font-weight: 600;
                color: #1E1E1E;
                font-size: 16px;
                line-height: 1.2;
            }

            textarea {
                width: 100%;
                min-height: 200px;
                padding: 12px 16px;
                border: 1px solid #d1d5db;
                border-radius: 8px;
                font-size: 14px;
                font-family: inherit;
                line-height: 1.6;
                resize: vertical;
                transition: border-color 0.2s ease;

                &:focus {
                    outline: none;
                    border-color: #008717;
                    box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
                }

                &::placeholder {
                    color: #9ca3af;
                    font-style: italic;
                }
            }
        }

        .summary-loading {
            text-align: center;
            padding: 40px 20px;
            color: #6b7280;

            .spinner {
                display: inline-block;
                width: 32px;
                height: 32px;
                border: 3px solid #e5e7eb;
                border-radius: 50%;
                border-top-color: #008717;
                animation: spin 1s ease-in-out infinite;
                margin-bottom: 16px;
            }

            h4 {
                margin: 0 0 8px 0;
                color: #374151;
                font-size: 18px;
                font-weight: 600;
            }

            p {
                margin: 0;
                color: #6b7280;
                font-size: 14px;
                line-height: 1.5;
            }
        }

        .summary-preview {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 20px;
            margin-top: 16px;

            .preview-header {
                display: flex;
                align-items: center;
                gap: 8px;
                margin-bottom: 16px;
                padding-bottom: 12px;
                border-bottom: 2px solid #e2e8f0;

                h4 {
                    margin: 0;
                    color: #1e293b;
                    font-size: 16px;
                    font-weight: 600;
                }
            }

            .preview-content {
                color: #334155;
                font-size: 14px;
                line-height: 1.7;

                p {
                    margin: 0 0 12px 0;

                    &:last-child {
                        margin-bottom: 0;
                    }
                }

                strong {
                    color: #1e293b;
                    font-weight: 600;
                }

                em {
                    color: #64748b;
                    font-style: italic;
                }

                ul,
                ol {
                    margin: 12px 0;
                    padding-left: 24px;

                    li {
                        margin: 6px 0;
                        color: #475569;
                        line-height: 1.6;
                        display: list-item;
                    }
                }

                ol {
                    list-style-type: decimal;
                }

                ul {
                    list-style-type: disc;
                }
            }

            .preview-note {
                margin-top: 16px;
                padding-top: 12px;
                border-top: 1px solid #e2e8f0;
                color: #64748b;
                font-size: 12px;
                font-style: italic;
                text-align: center;
            }
        }
    }

    .modal-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 30px;
        background: #f9fafb;
        border-top: 1px solid #e5e7eb;
        border-radius: 0 0 12px 12px;
        gap: 12px;

        .footer-left,
        .footer-right {
            display: flex;
            gap: 12px;
        }

        button {
            outline: 0;
            border: 0;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            box-shadow: none;
            font-weight: 600;
            text-align: center;
            padding: 12px 20px;
            border-radius: 8px;
            transition: all 0.3s ease;
            min-width: 120px;

            &.primary {
                background-color: #008717;

                &:hover:not(:disabled) {
                    background-color: #0688f5;
                }

                &:disabled {
                    background-color: #6c757d;
                    cursor: not-allowed;
                    opacity: 0.6;
                }
            }

            &.secondary {
                background-color: #6b7280;

                &:hover:not(:disabled) {
                    background-color: #4b5563;
                }
            }
        }
    }

    @media (max-width: 768px) {
        .modal-content {
            width: 95%;
            max-height: 90vh;
        }

        .modal-header,
        .modal-body,
        .modal-footer {
            padding: 20px;
        }

        .modal-footer {
            flex-direction: column;

            .footer-left,
            .footer-right {
                width: 100%;
                justify-content: center;
            }

            button {
                width: 100%;
            }
        }
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}




.btn-youtube {
    outline: 0;
    gap: 3px;
    color: #fa003e;
    background-color: rgba(43, 184, 133, 0.05);
    box-shadow: none;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    display: inline-flex;
    align-items: center;
    border-radius: 3.533px;
    padding: 2px 7px 2px 7px;
    border: 0.5px solid rgba(43, 184, 133, 0.05);
    box-shadow: none !important;
    transition: background-color 0.2s, color 0.2s;
    margin-left: 5px;
    cursor: pointer;
}

.btn-upcomming {
    outline: 0;
    gap: 3px;
    color: rgb(166, 1, 243);
    background-color: rgba(166, 1, 243, 0.05);
    box-shadow: none;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    display: inline-flex;
    align-items: center;
    border-radius: 3.533px;
    padding: 2px 7px 3px 7px;
    border: 0.5px solid rgba(166, 1, 243, 0.05);
    box-shadow: none !important;
    transition: all 0.3s ease;
}


// AI Wizard Section
.ai-wizard-section {
    padding: 32px;
    margin: 20px 0;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;


    .wizard-toggles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        margin-bottom: 40px;

        @media (max-width: 768px) {
            grid-template-columns: 1fr;
            gap: 16px;
        }

        .wizard-toggle-item {
            background: #F9FBFC;
            border: 2px solid #F9FBFC;
            border-radius: 12px;
            padding: 24px;
            transition: all 0.3s ease;
            cursor: pointer;

            &:hover {
                border-color: #ebf3f7;
                box-shadow: 0 4px 12px rgba(221, 236, 248, 0.15);
                transform: translateY(-2px);
            }

            .toggle-switch-container {
                display: flex;
                align-items: flex-start;
                gap: 16px;
                text-align: left;

                .toggle-switch {
                    position: relative;
                    display: inline-block;
                    width: 50px;
                    height: 24px;
                    flex-shrink: 0;
                    margin-top: 4px;

                    input {
                        opacity: 0;
                        width: 0;
                        height: 0;

                        &:checked+.slider {
                            background-color: #008717;

                            &:before {
                                transform: translateX(26px);
                            }
                        }
                    }

                    .slider {
                        position: absolute;
                        cursor: pointer;
                        top: 0;
                        left: 0;
                        right: 0;
                        bottom: 0;
                        background-color: #ccc;
                        transition: 0.3s ease;
                        border-radius: 24px;

                        &:before {
                            position: absolute;
                            content: "";
                            height: 18px;
                            width: 18px;
                            left: 3px;
                            bottom: 3px;
                            background-color: white;
                            transition: 0.3s ease;
                            border-radius: 50%;
                            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
                        }
                    }
                }

                .toggle-content {
                    h4 {
                        font-size: 18px;
                        font-weight: 600;
                        color: #1f2937;
                        margin: 0 0 8px 0;
                        line-height: 1.3;
                    }

                    p {
                        font-size: 14px;
                        color: #6b7280;
                        margin: 0;
                        line-height: 1.5;
                    }
                }
            }
        }
    }

    .wizard-setup {
        background: white;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        padding: 32px;
        margin-bottom: 24px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;

        .wizard-icon {
            font-size: 48px;
            margin-bottom: 8px;
        }

        .wizard-setup-content {

            &.shake-animation {
                animation: shake 0.6s ease-in-out;
            }

            text-align: center;

            h4 {
                font-size: 20px;
                font-weight: 600;
                color: #1f2937;
                margin: 0 0 8px 0;
                line-height: 1.3;
            }

            p {
                font-size: 14px;
                color: #6b7280;
                margin: 0 0 24px 0;
                line-height: 1.5;
            }

            .wizard-buttons {
                display: flex;
                gap: 16px;
                justify-content: center;
                flex-wrap: wrap;
                flex-direction: column;
                align-items: center;

                .setup-ai-button,
                .watch-tutorial-button {
                    padding: 12px 24px;
                    border-radius: 8px;
                    font-size: 14px;
                    font-weight: 600;
                    text-decoration: none;
                    transition: all 0.3s ease;
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    max-width: 200px;
                }



                .setup-ai-button {
                    background: #008717;
                    color: white;

                    &:hover {
                        background: #126E22;
                        transform: translateY(-2px);
                    }
                }

                .watch-tutorial-button {
                    color: #374151;

                    &:hover {
                        color: #008717;
                        transform: translateY(-2px);
                    }

                    span.yt-icosn {
                        gap: 13px;
                        display: flex;
                        margin-right: 5px;
                    }
                }
            }
        }
    }

    .wizard-note {
        background: #EFF2F7;
        border-radius: 8px;
        padding: 16px;
        font-size: 14px;
        color: #1E1E1E;
        text-align: center;
        margin: auto;
        width: 60%;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

// AI Settings Container
.ai-settings-container {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

// AI Feature Sections
.ai-feature-section {
    border-radius: 12px;
    transition: all 0.3s ease;


    .feature-toggle {
        padding: 24px;
        display: flex;
        // align-items: center;
        gap: 16px;


        .tooltip-cache {
            display: flex;
            align-items: center;
            gap: 10px;
            top: -20px;
            right: 95px;
            position: relative;

            button.btn-pro.btn-new {
                position: relative;
                top: 0px;
            }

        }

        .tooltip-cache.ai-table-sum-tooltip {
            .swptls-tooltip {
                margin-left: 50px;
                margin-top: -2px;
            }
        }

        .tooltip-cache.ai-table-prompt-tooltip {
            .swptls-tooltip {
                margin-left: -80px;
                margin-top: -5px;
            }

            button.btn-pro.btn-new {
                margin-top: -7px;
            }

        }

        button.btn-pro.btn-youtube {
            margin-top: -2px;
            cursor: pointer;
        }

        span.tooltip-cache.ai-ask-tooltip {
            top: -22px !important;
            right: 180px !important;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
            flex-shrink: 0;

            input {
                opacity: 0;
                width: 0;
                height: 0;

                &:checked+.slider {
                    background-color: #008717;

                    &:before {
                        transform: translateX(26px);
                    }
                }
            }

            .slider {
                position: absolute;
                cursor: pointer;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background-color: #ccc;
                transition: 0.3s ease;
                border-radius: 24px;

                &:before {
                    position: absolute;
                    content: "";
                    height: 18px;
                    width: 18px;
                    left: 3px;
                    bottom: 3px;
                    background-color: white;
                    transition: 0.3s ease;
                    border-radius: 50%;
                    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
                }
            }
        }

        .feature-info {
            h4 {
                font-size: 18px;
                font-weight: 600;
                color: #1f2937;
                margin: 0 0 4px 0;
                line-height: 1.3;
            }

            p {
                font-size: 14px;
                color: #6b7280;
                margin-left: -65px;
                line-height: 1.4;
            }


        }
    }
}

// Summary Source Selection
.summary-source-section {
    padding: 24px;

    .section-title {
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
        margin: 0 0 16px 0;
    }

    .source-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-bottom: 24px;
        // max-width: 900px;
        max-width: 565px;

        @media (max-width: 768px) {
            grid-template-columns: 1fr;
        }

        .source-option {
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 160px;

            &:hover {
                border-color: #008717;
                box-shadow: 0 4px 12px rgba(52, 250, 52, 0.15);
            }

            &.active {
                border-color: #008717;

            }

            .option-icon {
                font-size: 24px;
                margin-bottom: 8px;
            }

            .option-content {
                flex: 1;

                .summary-sorce {
                    display: flex;
                    gap: 5px;
                    align-items: center;

                    .swptls-tooltip {
                        margin-top: -3px;
                    }

                    button.btn-pro.btn-new {
                        margin-top: -5px;
                    }
                }

                h6 {
                    font-size: 16px;
                    font-weight: 600;
                    color: #1f2937;
                    margin: 0 0 8px 0;
                    line-height: 1.3;
                }

                p {
                    font-size: 13px;
                    color: #6b7280;
                    margin: 0;
                    line-height: 1.5;
                }
            }

            .option-check {
                position: absolute;
                top: 12px;
                right: 12px;
                width: 20px;
                height: 20px;
                border-radius: 50%;
                background: #008717;
                color: white;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 12px;
                font-weight: bold;
                opacity: 0;
                transition: opacity 0.3s ease;

                span {
                    line-height: 1;
                }
            }

            &.active .option-check {
                opacity: 1;
            }
        }
    }
}

// Generate on Click Settings
.generate-on-click-settings {
    .prompt-section {
        margin-bottom: 24px;

        .summary-text-prompt {
            position: relative;
        }



        .setting-label {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 8px;
            display: block;
        }

        .setting-textarea {
            width: 70%;
            min-height: 100px;
            padding: 25px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            line-height: 1.5;
            resize: vertical;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;

            &:focus {
                outline: none;
                border-color: #008717;
                box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
            }
        }

        .prompt-actions {
            display: flex;
            justify-content: flex-end;
            margin-top: 8px;
            width: 70%;

            .reset-prompt-btn {
                background: none;
                border: unset;
                color: #6b7280;
                padding: 6px 12px;
                border-radius: 6px;
                font-size: 12px;
                cursor: pointer;
                transition: all 0.2s ease;

                &:hover:not(.disabled) {
                    border-color: #008717;
                    color: #008717;
                }

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

    .summary-button-section {
        margin-bottom: 24px;

        .summary-title-toggle {
            display: flex;
            align-items: center;
            text-align: center;
        }

        h6 {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin: 0 0 4px 0;
        }

        p {
            font-size: 13px;
            color: #6b7280;
            margin: 0 0 16px 0;
        }

        .button-settings {

            position: relative;
            background: #FAFAFA;
            padding: 15px;
            width: 330px;

            .setting-row {
                margin-bottom: 16px;

                label {
                    font-size: 13px;
                    font-weight: 500;
                    color: #374151;
                    min-width: 120px;
                }

                input[type="text"] {
                    flex: 1;
                    padding: 8px 12px;
                    border: 1px solid #d1d5db;
                    border-radius: 6px;
                    font-size: 14px;
                    width: 230px;

                    &:focus {
                        outline: none;
                        border-color: #008717;
                        box-shadow: 0 0 0 2px rgba(52, 160, 250, 0.1);
                    }
                }
            }

            .color-settings {
                display: flex;
                flex-direction: column;
                gap: 20px;
                flex-wrap: wrap;

                .color-setting {
                    display: flex;
                    align-items: center;
                    gap: 8px;

                    input[type="color"] {
                        width: 32px;
                        height: 32px;
                        border: none;
                        border-radius: 6px;
                        cursor: pointer;
                    }

                    label {
                        font-size: 13px;
                        font-weight: 500;
                        color: #374151;
                        white-space: nowrap;
                        margin-bottom: 0px;
                    }

                    .swptls-tooltip {
                        margin-bottom: -5px;
                    }
                }
            }
        }
    }

    .summary-position-section,
    .cache-section,
    .regenerate-button-section {
        margin-bottom: 24px;

        .summary-title-section {
            .summary-btn-text {
                display: flex;
                align-items: center;

                label {
                    margin-bottom: 5px;
                }
            }

            input[type=text] {
                flex: 1;
                padding: 8px 12px;
                border: 1px solid #d1d5db;
                border-radius: 6px;
                font-size: 14px;
                width: 230px;
            }

            /* .btn-pro{
                padding: ;
            } */

        }

        &.pro-locked {
            position: relative;

            .checkbox-toggle {
                opacity: 0.6;
                pointer-events: none;

                input[type="checkbox"] {
                    cursor: not-allowed;
                }

                .checkbox-label {
                    cursor: not-allowed;
                }
            }

            .btn-pro-lock {
                position: absolute;
                top: 50%;
                right: 10px;
                transform: translateY(-50%);
                z-index: 10;
            }
        }

        span.cache-time {
            border: 2px solid #d6d6d6;
            padding: 2px 12px 2px 12px;
            border-radius: 15px;
        }

        h6 {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin: 0 0 4px 0;
        }

        p {
            font-size: 13px;
            color: #6b7280;
            margin: 0 0 12px 0;
        }

        .position-select {
            width: 230px;
            padding: 8px 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;

            &:focus {
                outline: none;
                border-color: #008717;
                box-shadow: 0 0 0 2px rgba(52, 160, 250, 0.1);
            }
        }
    }

    .cache-section {
        .checkbox-toggle {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 0px;

            .checkbox-label {
                font-weight: 600;
                color: #374151;
                font-size: 14px;
                display: flex;
                align-items: center;
                cursor: pointer;
                line-height: 1.4;

                input[type="checkbox"] {
                    position: relative;
                    border: 1px solid #bbbdca;
                    border-radius: 5px;
                    background: none;
                    cursor: pointer;
                    line-height: 0;
                    margin: 0 0.6em 0 0;
                    outline: 0;
                    padding: 0 !important;
                    vertical-align: text-top;
                    height: 19px;
                    width: 19px;
                    -webkit-appearance: none;
                    appearance: none;
                    box-sizing: border-box;
                    flex-shrink: 0;

                    &:checked {
                        background-color: #008717;
                    }

                    &:checked::before {
                        content: "";
                        position: absolute;
                        right: 53%;
                        top: 50%;
                        width: 4px;
                        height: 10px;
                        border: solid #fff;
                        border-width: 0 2px 2px 0;
                        margin: -1px -1px 0 -1px;
                        transform: rotate(45deg) translate(-53%, -50%);
                        z-index: 2;
                    }

                    &:focus {
                        outline: none;
                        box-shadow: none;
                        border: 1px solid #bbbdca;
                    }
                }
            }
        }

        .cache-time {
            margin-left: 8px;
            font-size: 12px;
            color: #6b7280;

            .adjust-link {
                color: #008717;
                text-decoration: none;
                margin-left: 4px;

                &:hover {
                    text-decoration: underline;
                }
            }
        }

        .setting-description {
            font-size: 13px;
            color: #6b7280;
            line-height: 1.5;
        }
    }
}

// Instant Summary Settings
.instant-summary-settings {
    .instant-summary-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        margin-top: 60px;

        @media (max-width: 1024px) {
            grid-template-columns: 1fr;
            gap: 24px;
        }

        .instant-summary-left {
            .prompt-section {
                margin-bottom: 24px;

                h6 {
                    font-size: 14px;
                    font-weight: 600;
                    color: #374151;
                    margin: 0 0 4px 0;
                }

                p {
                    font-size: 13px;
                    color: #6b7280;
                    margin: 0 0 12px 0;
                }

                .setting-textarea {
                    width: 100%;
                    min-height: 100px;
                    padding: 25px;
                    border: 1px solid #d1d5db;
                    border-radius: 8px;
                    font-size: 14px;
                    resize: vertical;

                    &:focus {
                        outline: none;
                        border-color: #008717;
                        box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
                    }
                }

                .prompt-actions {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin: 8px 0 16px 0;

                    .reset-prompt-btn {
                        background: none;
                        border: unset;
                        color: #6b7280;
                        padding: 6px 12px;
                        border-radius: 6px;
                        font-size: 12px;
                        cursor: pointer;

                        &:hover:not(.disabled) {
                            border-color: #008717;
                            color: #008717;
                        }

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

                    .last-generated {
                        font-size: 12px;
                        color: #6b7280;
                    }
                }

                .generate-summary-btn {
                    width: 100%;
                    padding: 12px 20px;
                    background: #008717;
                    color: white;
                    border: none;
                    border-radius: 8px;
                    font-size: 14px;
                    font-weight: 600;
                    cursor: pointer;
                    transition: all 0.3s ease;

                    &:hover:not(:disabled) {
                        transform: translateY(-2px);
                        box-shadow: 0 6px 20px rgba(52, 160, 250, 0.35);
                    }

                    &:disabled {
                        opacity: 0.6;
                        cursor: not-allowed;
                        transform: none;
                    }
                }
            }

            .summary-position-section,
            .summary-display-section {
                margin-bottom: 24px;

                h6 {
                    font-size: 14px;
                    font-weight: 600;
                    color: #374151;
                    margin: 0 0 4px 0;
                }

                p {
                    font-size: 13px;
                    color: #6b7280;
                    margin: 0 0 12px 0;
                }

                .position-select {
                    width: 230px;
                    padding: 8px 12px;
                    border: 1px solid #d1d5db;
                    border-radius: 6px;
                    font-size: 14px;

                    &:focus {
                        outline: none;
                        border-color: #008717;
                    }
                }

                .summary-title-section {
                    .summary-btn-text {
                        display: flex;
                        align-items: center;

                        label {
                            margin-bottom: 5px;
                        }

                        button.btn-pro {
                            margin-top: -5px;
                        }
                    }

                    input[type=text] {
                        flex: 1;
                        padding: 8px 12px;
                        border: 1px solid #d1d5db;
                        border-radius: 6px;
                        font-size: 14px;
                        width: 230px;
                    }

                }


                .radio-options {
                    display: flex;
                    flex-direction: column;
                    gap: 8px;

                    .radio-option {
                        display: flex;
                        align-items: center;
                        gap: 8px;
                        cursor: pointer;
                        font-size: 14px;
                        color: #374151;

                        input[type="radio"] {
                            margin: 0;
                        }
                    }
                }
            }
        }

        .instant-summary-right {
            .summary-preview-section {

                .summary-preview-title {
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                }

                h6 {
                    font-size: 14px;
                    font-weight: 600;
                    color: #374151;
                    margin: 0 0 4px 0;
                }

                p {
                    font-size: 13px;
                    color: #6b7280;
                    margin: 0 0 16px 0;
                }

                .no-summary-placeholder {
                    background: #f9fafb;
                    border: 2px dashed #d1d5db;
                    border-radius: 12px;
                    padding: 40px 20px;
                    text-align: center;

                    .placeholder-icon {
                        font-size: 48px;
                        margin-bottom: 16px;
                    }

                    .placeholder-content {
                        h6 {
                            font-size: 16px;
                            font-weight: 600;
                            color: #374151;
                            margin: 0 0 8px 0;
                        }

                        p {
                            font-size: 14px;
                            color: #6b7280;
                            margin: 0;
                        }
                    }
                }

                .summary-preview-container {
                    border: 1px solid #e5e7eb;
                    border-radius: 8px;
                    overflow: hidden;

                    .preview-tabs {
                        display: flex;
                        background: #f9fafb;
                        border-bottom: none;

                        .preview-tab {
                            flex: 1;
                            padding: 12px 16px;
                            background: none;
                            border: none;
                            cursor: pointer;
                            font-size: 14px;
                            font-weight: 500;
                            color: #6b7280;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            gap: 6px;
                            transition: all 0.2s ease;

                            &.active {
                                background: white;
                                color: #374151;
                                border-bottom: 1px solid #008717;
                            }

                            .tab-icon {
                                font-size: 16px;
                            }
                        }
                    }

                    .edit-summary-container {
                        padding: 16px;
                        height: 310px;

                        .markdown-toolbar {
                            display: flex;
                            gap: 8px;
                            margin-bottom: 12px;
                            padding-bottom: 12px;

                            .markdown-btn {
                                padding: 6px 10px;
                                background: #f3f4f6;
                                border: 1px solid #d1d5db;
                                border-radius: 4px;
                                font-size: 12px;
                                cursor: pointer;
                                transition: all 0.2s ease;

                                &:hover {
                                    background: #e5e7eb;
                                }
                            }
                        }

                        .edit-summary-textarea {
                            width: 100%;
                            min-height: 200px;
                            padding: 12px;
                            border: 1px solid #d1d5db;
                            border-radius: 6px;
                            font-size: 14px;
                            resize: vertical;
                            margin-bottom: 12px;

                            &:focus {
                                outline: none;
                                border-color: #008717;
                            }

                            &::-webkit-scrollbar {
                                width: 8px;
                            }

                            &::-webkit-scrollbar-track {
                                background: #ffffff;
                            }

                            &::-webkit-scrollbar-thumb {
                                background: #d1d5db;
                                border-radius: 4px;

                                &:hover {
                                    background: #9ca3af;
                                }
                            }

                            // Firefox scrollbar
                            scrollbar-width: thin;
                            scrollbar-color: #d1d5db #ffffff;

                        }

                        .edit-actions {
                            display: flex;
                            gap: 12px;
                            margin-top: 12px;
                            justify-content: right;

                            .delete-summary-btn {
                                background: white;
                                color: #dc2626;
                                border: 1px solid #dc2626;
                                padding: 10px 20px;
                                border-radius: 6px;
                                font-size: 14px;
                                font-weight: 600;
                                cursor: pointer;
                                transition: all 0.3s ease;

                                &:hover {
                                    background: #dc2626;
                                    color: white;
                                    transform: translateY(-1px);
                                    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
                                }
                            }


                            .save-summary-btn {
                                background: #008717;
                                color: white;
                                border: none;
                                padding: 10px 20px;
                                border-radius: 6px;
                                font-size: 14px;
                                font-weight: 600;
                                cursor: pointer;
                                transition: all 0.3s ease;

                                &:hover:not(:disabled) {
                                    transform: translateY(-1px);
                                    box-shadow: 0 4px 12px rgba(52, 160, 250, 0.25);
                                }

                                &:disabled {
                                    opacity: 0.6;
                                    cursor: not-allowed;
                                    transform: none;
                                }
                            }
                        }


                    }

                    .summary-preview-content {
                        padding: 16px;
                        font-size: 14px;
                        line-height: 1.6;
                        color: #374151;

                        // Add to scroll 
                        width: 100%;
                        height: 310px;
                        overflow-y: scroll;

                        &::-webkit-scrollbar {
                            width: 8px;
                        }

                        &::-webkit-scrollbar-track {
                            background: #ffffff;
                        }

                        &::-webkit-scrollbar-thumb {
                            background: #d1d5db;
                            border-radius: 4px;

                            &:hover {
                                background: #9ca3af;
                            }
                        }

                        // Firefox scrollbar
                        scrollbar-width: thin;
                        scrollbar-color: #d1d5db #ffffff;

                        .summary-panel {
                            border: 1px solid #e2e8f0;
                            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
                            border-radius: 1.5rem;
                            background-color: rgba(15, 115, 248, 0.14902);
                            color: #525252;
                            flex-flow: column;
                            justify-content: flex-start;
                            align-items: flex-start;
                            padding: 1.5rem;
                            display: flex;

                            // AI Summary Header inside panel
                            .ai-summary-header {
                                display: flex;
                                align-items: center;
                                gap: 12px;
                                margin-bottom: 10px;
                                border-bottom: 1px solid #e5e7eb;

                                .ai-icon {
                                    display: flex;
                                    align-items: center;
                                    justify-content: center;
                                    flex-shrink: 0;

                                    svg {
                                        width: 24px;
                                        height: 25px;
                                    }
                                }

                                .summary-title {
                                    margin: 0;
                                    font-size: 16px;
                                    font-weight: 600;
                                    color: #1f2937;
                                    line-height: 1.4;
                                }
                            }



                        }


                    }
                }
            }
        }
    }
}

// Ask AI Settings
.ask-ai-settings {
    padding: 24px;

    .ask-ai-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;

        @media (max-width: 768px) {
            grid-template-columns: 1fr;
            gap: 24px;
        }

        .ask-ai-left {

            .placeholder-section,
            .button-label-section {
                margin-bottom: 24px;

                h6 {
                    font-size: 14px;
                    font-weight: 600;
                    color: #374151;
                    margin: 0 0 4px 0;
                }

                p {
                    font-size: 13px;
                    color: #6b7280;
                    margin: 0 0 8px 0;
                }

                input[type="text"] {
                    width: 100%;
                    padding: 10px 12px;
                    border: 1px solid #d1d5db;
                    border-radius: 6px;
                    font-size: 14px;
                    color: #1e1e1e;

                    &:focus {
                        outline: none;
                        border-color: #008717;
                        box-shadow: 0 0 0 2px rgba(52, 160, 250, 0.1);
                    }
                }
            }
        }

        .ask-ai-right {
            .ask-ai-preview {
                h6 {
                    font-size: 14px;
                    font-weight: 600;
                    color: #374151;
                    margin: 0 0 12px 0;
                }

                .browser-mockup {
                    border: 1px solid #e5e7eb;
                    border-radius: 8px;
                    overflow: hidden;
                    background: white;
                    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

                    .browser-header {
                        background: #f3f4f6;
                        padding: 8px 12px;
                        display: flex;
                        align-items: center;
                        gap: 12px;
                        border-bottom: 1px solid #e5e7eb;
                    }

                    .browser-content {
                        padding: 20px;
                        background: #FAFAFA;

                        .preview-container {
                            display: flex;
                            gap: 8px;
                            align-items: center;
                            margin-bottom: 12px;

                            .preview-input {
                                flex: 1;
                                padding: 10px 12px;
                                border: 1px solid #d1d5db;
                                border-radius: 6px;
                                font-size: 14px;
                                // background: #f9fafb;
                                color: #1e1e1e;
                            }

                            .preview-button {
                                padding: 10px 16px;
                                background: #008717;
                                color: white;
                                border: none;
                                border-radius: 6px;
                                font-size: 14px;
                                font-weight: 500;
                                cursor: pointer;
                                white-space: nowrap;
                                transition: background 0.2s;

                                &:hover {
                                    background: #006d13;
                                }
                            }
                        }

                        .preview-hint {
                            font-size: 13px;
                            color: #6b7280;
                            margin: 0;
                            line-height: 1.5;
                        }
                    }
                }
            }
        }
    }
}

// New improved AI Integration layout styles
.ai-integration-header {

    .title {
        margin-bottom: 12px;
        color: #1f2937;
        font-size: 18px;
        font-weight: 600;
    }
}

.ai-settings-container {
    display: flex;
    flex-direction: column;
    // gap: 24px;
    margin-top: 20px;
}

.ai-settings-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    margin-top: 15px;

    &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    &.backend-summary-section {
        border-color: #008717;
        box-shadow: 0 2px 8px rgba(52, 160, 250, 0.1);
    }

    .setting-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
        padding: 0px;
    }
}

.section-header {
    background: #FAFAFA;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;

    .section-title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
        display: flex;
        align-items: center;
        gap: 8px;

        .section-icon {
            font-size: 18px;
        }
    }

    .backend-summary-section & {
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
        border-bottom-color: #bfdbfe;
    }
}

.settings-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;

    select#summary-position {
        width: 140px;
        padding: 8px 10px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background-color: #f9f9f9;
        font-size: 14px;
        color: #333;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        cursor: pointer;
        margin: 0px 0px 0px 5px;
    }

    &.full-width {
        grid-column: 1 / -1;
    }

    &.advanced-feature {
        position: relative;
        padding: 16px;
        background: linear-gradient(135deg, #f6f7fe 0%, #f6f7fe 100%);
        border: 1px solid #f6f7fe;
        border-radius: 8px;

        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #f6f7fe, #f6f7fe);
            border-radius: 8px 8px 0 0;
        }
    }
}

.setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}


// Toggle Switch Styles for Advanced Features
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;

    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 50px;
        height: 24px;
        flex-shrink: 0;

        input {
            opacity: 0;
            width: 0;
            height: 0;

            &:checked+.slider {
                background-color: #008717;

                &:before {
                    transform: translateX(26px);
                }
            }

            &:focus+.slider {
                box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.2);
            }
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: 0.3s ease;
            border-radius: 24px;

            &:before {
                position: absolute;
                content: "";
                height: 18px;
                width: 18px;
                left: 3px;
                bottom: 3px;
                background-color: white;
                transition: 0.3s ease;
                border-radius: 50%;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            }
        }
    }

    .toggle-label {
        display: flex;
        flex-direction: column;
        gap: 4px;

        .setting-label {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin: 0;
            margin-top: -9px;
        }
    }
}

// Checkbox Styles (matching original design)
.checkbox-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    .checkbox-label {
        font-weight: 600;
        color: #374151;
        font-size: 14px;
        display: flex;
        align-items: center;
        cursor: pointer;
        line-height: 1.4;

        input[type="checkbox"] {
            position: relative;
            border: 1px solid #bbbdca;
            border-radius: 5px;
            background: none;
            cursor: pointer;
            line-height: 0;
            margin: 0 0.6em 0 0;
            outline: 0;
            padding: 0 !important;
            vertical-align: text-top;
            height: 19px;
            width: 19px;
            -webkit-appearance: none;
            appearance: none;
            outline: none;
            box-shadow: none;
            box-sizing: border-box;
            flex-shrink: 0;

            &:checked {
                background-color: #008717;
            }

            &:checked::before {
                content: "";
                position: absolute;
                right: 53%;
                top: 50%;
                width: 4px;
                height: 10px;
                border: solid #fff;
                border-width: 0 2px 2px 0;
                margin: -1px -1px 0 -1px;
                transform: rotate(45deg) translate(-53%, -50%);
                z-index: 2;
            }

            &:focus {
                outline: none;
                box-shadow: none;
                border: 1px solid #bbbdca;
            }
        }
    }
}

.setting-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    input[type="checkbox"] {
        margin-top: 2px;
        flex-shrink: 0;
    }
}

.setting-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

// Textarea container with edit icon
.textarea-container {
    position: relative;

    .setting-textarea {
        width: 100%;
        min-height: 100px;
        padding: 25px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 14px;
        font-family: inherit;
        line-height: 1.5;
        resize: vertical;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;

        &:focus {
            outline: none;
            border-color: #008717;
            box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
        }

        &::placeholder {
            color: #9ca3af;
            font-style: italic;
        }

        &.disabled {
            background-color: #f9fafb;
            color: #6b7280;
            cursor: not-allowed;

            &:focus {
                border-color: #d1d5db;
                box-shadow: none;
            }
        }
    }

    .edit-prompt-icon {
        position: absolute;
        top: 1px;
        right: 1px;
        background: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 6px;
        cursor: pointer;
        color: #6b7280;
        transition: all 0.2s ease;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

        &:hover {
            background: #f3f4f6;
            border-color: #9ca3af;
            color: #374151;
        }

        &.editing {
            background: #fef3c7;
            border-color: #f59e0b;
            color: #d97706;
            display: none;

            /* &:hover {
                background: #fde68a;
                border-color: #d97706;
            } */
        }

        svg {
            display: block;
            width: 16px;
            height: 16px;
        }
    }
}

.setting-textarea {
    width: 100%;
    min-height: 100px;
    padding: 25px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;

    &:focus {
        outline: none;
        border-color: #008717;
        box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
    }

    &::placeholder {
        color: #9ca3af;
        font-style: italic;
    }
}

.setting-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;

    &:focus {
        outline: none;
        border-color: #008717;
        box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
    }
}

.summary-actions {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e5e7eb;

    .action-buttons {
        display: flex;
        gap: 12px;
        margin-bottom: 12px;
        flex-wrap: wrap;

        .ui.button {
            outline: 0;
            border: 0;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            box-shadow: none;
            font-weight: 600;
            position: relative;
            text-align: center;
            font-style: normal;
            padding: 12px 20px;
            border-radius: 8px;
            line-height: normal;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 80px;

            .button-spinner {
                width: 16px;
                height: 16px;
                border: 2px solid rgba(255, 255, 255, 0.3);
                border-radius: 50%;
                border-top-color: white;
                animation: spin 1s linear infinite;
                margin-right: 8px;
            }

            &.violet {
                background-color: #008717;

                &:hover:not(:disabled) {
                    background-color: #0688f5;
                }

                &:active:not(:disabled) {
                    background-color: #0570d1;
                }
            }

            &.red {
                background-color: #dc3545;

                &:hover:not(:disabled) {
                    background-color: #c82333;
                }

                &:active:not(:disabled) {
                    background-color: #bd2130;
                }
            }

            &:disabled {
                opacity: 0.6;
                cursor: not-allowed;
                background-color: #6c757d !important;
            }

            &:focus {
                outline: none;
                box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.25);
            }
        }

        @media (max-width: 480px) {
            flex-direction: column;

            .ui.button {
                width: 100%;
                min-width: auto;
            }
        }
    }

    .action-description {
        font-size: 13px;
        color: #6b7280;
        margin: 0;
        line-height: 1.4;
    }
}

.current-summary-preview {
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;

    .preview-header {
        margin-bottom: 16px;

        .preview-title {
            margin: 0;
            font-size: 15px;
            font-weight: 600;
            color: #374151;
            display: flex;
            align-items: center;
            gap: 8px;

            .preview-icon {
                font-size: 16px;
            }
        }
    }

    .summary-preview-card {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;

        .summary-content {
            font-size: 14px;
            line-height: 1.6;
            color: #374151;

            p {
                margin: 0 0 10px 0;

                &:last-child {
                    margin-bottom: 0;
                }
            }

            strong {
                font-weight: 600;
                color: #1f2937;
            }

            em {
                font-style: italic;
                color: #4b5563;
            }

            ul,
            ol {
                margin: 10px 0;
                padding-left: 24px;

                li {
                    margin: 4px 0;
                    color: #374151;
                    line-height: 1.6;

                    strong {
                        color: #1f2937;
                        font-weight: 600;
                    }

                    em {
                        color: #4b5563;
                        font-style: italic;
                    }
                }
            }

            ol {
                list-style-type: decimal;

                li {
                    display: list-item;
                }
            }

            ul {
                list-style-type: disc;

                li {
                    display: list-item;
                }
            }
        }
    }

    .preview-note {
        font-size: 12px;
        color: #6b7280;
        font-style: italic;
        margin: 0;
        text-align: center;
    }
}

// En
hanced Instant Summary Settings .instant-summary-settings {
    .instant-summary-layout {
        .instant-summary-left {
            .prompt-section {
                .generate-summary-btn {
                    background: #008717;
                    color: white;
                    border: none;
                    padding: 12px 24px;
                    border-radius: 8px;
                    font-size: 14px;
                    font-weight: 600;
                    cursor: pointer;
                    transition: all 0.3s ease;
                    margin: 16px 0;
                    width: 100%;

                    &:hover:not(:disabled) {
                        transform: translateY(-2px);
                        box-shadow: 0 6px 20px rgba(52, 160, 250, 0.35);
                    }

                    &:disabled {
                        opacity: 0.7;
                        cursor: not-allowed;
                        transform: none;
                    }
                }

                .prompt-actions {
                    .last-generated {
                        font-size: 12px;
                        color: #6b7280;
                    }
                }
            }
        }


    }
}

//Summary actions in prompt section
.instant-summary-settings {
    .prompt-section {
        .prompt-actions {
            .summary-actions {
                display: flex;
                align-items: center;
                gap: 12px;

                .last-generated {
                    font-size: 12px;
                    color: #6b7280;
                }

                .delete-summary-link {
                    background: none;
                    border: none;
                    color: #dc2626;
                    font-size: 12px;
                    font-weight: 500;
                    cursor: pointer;
                    text-decoration: underline;
                    padding: 0;
                    transition: color 0.2s ease;

                    &:hover {
                        color: #b91c1c;
                    }
                }
            }
        }
    }
}

// Generating message inside preview 
.summary-preview-content {
    .generating-message {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        text-align: center;
        min-height: 150px;

        .spinner {
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 2px solid #e5e7eb;
            border-radius: 50%;
            border-top-color: #008717;
            animation: spin 1s ease-in-out infinite;
            margin-bottom: 12px;
        }

        p {
            margin: 0;
            color: #6b7280;
            font-size: 14px;
            font-style: italic;
        }
    }
}

// Markdown toolbar positioned between tabs and content 
.summary-preview-container {
    .markdown-toolbar {
        display: flex;
        gap: 8px;
        padding: 12px 16px;
        background: #f9fafb;
        border-bottom: none;
        margin: 0; // Remove any existing margins

        .markdown-btn {
            background: white;
            border: 1px solid #d1d5db;
            border-radius: 4px;
            padding: 6px 10px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            color: #374151;
            font-weight: 500;
            min-width: 40px;
            display: flex;
            align-items: center;
            justify-content: center;

            &:hover {
                border-color: #008717;
                color: #008717;
                background: rgba(52, 160, 250, 0.05);
            }

            strong,
            em {
                font-size: 12px;
            }
        }
    }

    .edit-summary-container {
        padding: 16px;

        // Remove the old toolbar styles since it's now outside
        .markdown-toolbar {
            display: none; // Hide any old toolbar inside edit container
        }

        .edit-summary-textarea {
            width: 100%;
            min-height: 200px;
            padding: 12px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            line-height: 1.6;
            resize: vertical;
            transition: border-color 0.2s ease;

            &:focus {
                outline: none;
                border-color: #008717;
                box-shadow: 0 0 0 3px rgba(52, 160, 250, 0.1);
            }
        }
    }
}


// Fix markdown toolbar positioning - between tabs and content
.instant-summary-settings {
    .summary-preview-container {
        display: flex;
        flex-direction: column;

        .preview-tabs {
            order: 1;
            display: flex;
            background: #f9fafb;
            border-bottom: none;
        }

        >.markdown-toolbar {
            order: 2;
            display: flex;
            gap: 8px;
            padding: 12px 16px;
            background: #f9fafb;
            border-bottom: 1px solid #e5e7eb;
            margin: 0;

            .markdown-btn {
                background: white;
                border: 1px solid #d1d5db;
                border-radius: 4px;
                padding: 6px 10px;
                font-size: 12px;
                cursor: pointer;
                transition: all 0.2s ease;
                color: #374151;
                font-weight: 500;
                min-width: 40px;
                display: flex;
                align-items: center;
                justify-content: center;

                &:hover {
                    border-color: #008717;
                    color: #008717;
                    background: rgba(52, 160, 250, 0.05);
                }

                strong,
                em {
                    font-size: 12px;
                }
            }
        }

        .edit-summary-container,
        .summary-preview-content {
            order: 3;
        }

        .edit-summary-container {
            padding: 16px;

            // Hide any old toolbar inside edit container
            .markdown-toolbar {
                display: none !important;
            }
        }
    }
}

// AI Section Separator 

.ai-section-separator {
    height: 1px;
    background-color: #e5e7eb;
    margin: 24px 0;
    width: 100%;
}

// Round Color Inputs
.round-color-input {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    border: 2px solid #e5e7eb !important;
    cursor: pointer !important;
    padding: 0 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;

    &:hover {
        border-color: #d1d5db !important;
    }

    &:focus {
        outline: none !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    }

    // Make the color swatch inside the input circular
    &::-webkit-color-swatch-wrapper {
        padding: 0 !important;
        border: none !important;
        border-radius: 50% !important;
    }

    &::-webkit-color-swatch {
        border: none !important;
        border-radius: 50% !important;
    }

    // Firefox support
    &::-moz-color-swatch {
        border: none !important;
        border-radius: 50% !important;
    }

    &::-moz-focus-inner {
        border: 0 !important;
        padding: 0 !important;
    }
}

//
Summary Display Section .summary-display-section {
    margin-bottom: 24px;

    h6 {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin: 0 0 4px 0;
    }

    p {
        font-size: 13px;
        color: #6b7280;
        margin: 0 0 12px 0;
    }

    .radio-options {
        display: flex;
        flex-direction: column;
        gap: 8px;

        .radio-option {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 14px;
            color: #374151;

            input[type="radio"] {
                margin: 0;
                cursor: pointer;
            }

            &:hover {
                color: #008717;
            }
        }
    }
}

// Display Options (similar to source options)
.display-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }

    .display-option {
        background: white;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        padding: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-height: 120px;

        &:hover {
            border-color: #008717;
            box-shadow: 0 4px 12px rgba(52, 250, 52, 0.15);
        }

        &.active {
            border-color: #008717;
            background: linear-gradient(135deg, #edfff8 0%, #eafff7 100%);
            box-shadow: 0 4px 12px #00871745;
        }

        .option-icon {
            font-size: 24px;
            margin-bottom: 8px;
        }

        .option-content {
            flex: 1;

            h6 {
                font-size: 16px;
                font-weight: 600;
                color: #1f2937;
                margin: 0 0 8px 0;
                line-height: 1.3;
            }

            p {
                font-size: 13px;
                color: #6b7280;
                margin: 0;
                line-height: 1.5;
            }
        }

        .option-check {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #008717;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
            opacity: 0;
            transition: opacity 0.3s ease;

            span {
                line-height: 1;
            }
        }

        &.active .option-check {
            opacity: 1;
        }
    }
}

// Enhanced Browser Mockup Styles
.browser-mockup-enhanced {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 16px;

    .browser-header {
        background: #f6f8fa;
        border-bottom: 1px solid #e1e5e9;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 44px;

        .browser-dots {
            display: flex;
            gap: 6px;
            align-items: center;

            .dot {
                width: 12px;
                height: 12px;
                border-radius: 50%;

                &.red {
                    background-color: #ff5f57;
                }

                &.yellow {
                    background-color: #ffbd2e;
                }

                &.green {
                    background-color: #28ca42;
                }
            }
        }

        .browser-title {
            font-size: 13px;
            color: #656d76;
            font-weight: 500;
            flex: 1;
            text-align: center;
            margin-right: 30px; // Compensate for dots width
        }
    }

    .browser-content {
        padding: 20px;
        min-height: 200px;
        background: #ffffff;

        .summary-preview-container {
            .github-editor-header {
                margin: 0;
                border-radius: 0;
            }

            .edit-summary-container,
            .summary-preview-content {
                padding: 20px;
                background: #ffffff;
                border: none;
                border-radius: 0;
            }
        }
    }
}

.browser-content.browser-content-ai-summary {
    padding: unset;
}

// GitHub-style Editor Header
.github-editor-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    justify-content: space-between;
    background: #f6f8fa;
    padding: 0;
    width: 100%;
    border-bottom: none;
    position: relative;

    .preview-tabs {
        display: flex;
        align-items: stretch;
        order: 1; // Ensure tabs are on the left
        flex-shrink: 0;
        position: relative;

        .preview-tab {
            background: #f6f8fa;
            border: 1px solid #e1e5e9;
            border-bottom: none;
            padding: 12px 16px;
            font-size: 14px;
            color: #656d76;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s ease;
            font-weight: 500;
            position: relative;
            border-radius: 6px 6px 0 0;
            margin-right: -1px; // Overlap borders
            z-index: 1;

            .tab-icon {
                display: flex;
                align-items: center;

                svg {
                    width: 16px;
                    height: 16px;
                }
            }

            &:hover {
                color: #24292f;
                background: rgba(255, 255, 255, 0.8);
            }

            &.active {
                color: #24292f;
                background: #ffffff;
                border-bottom: 1px solid #ffffff; // Connect to content
                z-index: 3;

                // Remove bottom border to connect seamlessly with content
                &::after {
                    content: '';
                    position: absolute;
                    bottom: -1px;
                    left: 0;
                    right: 0;
                    height: 1px;
                    background: #ffffff;
                    z-index: 4;
                }
            }

            &:not(.active) {
                // Inactive tabs have bottom border
                border-bottom: 1px solid #e1e5e9;

                &:hover {
                    border-color: #d1d9e0;
                }
            }

            &:first-child {
                margin-left: 0;
            }

            &:last-child {
                margin-right: 0;
            }
        }
    }

    .header-right-section {
        display: flex;
        align-items: stretch;
        order: 2; // Ensure toolbar is on the right
        flex-shrink: 0;
        margin-left: auto; // Push to the right
        border-bottom: none;

        .markdown-toolbar {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 16px;
            background: #f6f8fa;
            border-left: none;

            .markdown-btn {
                background: none;
                border: 1px solid #d1d9e0;
                border-radius: 4px;
                padding: 6px 8px;
                font-size: 12px;
                color: #656d76;
                cursor: pointer;
                transition: all 0.2s ease;
                min-width: 32px;
                height: 28px;
                display: flex;
                align-items: center;
                justify-content: center;

                &:hover {
                    background: #f3f4f6;
                    border-color: #afb8c1;
                    color: #24292f;
                }

                &:active {
                    background: #e1e5e9;
                }

                strong,
                em {
                    font-size: 12px;
                }
            }
        }
    }
}

// Enhanced Ask AI Preview
.ask-ai-preview {
    .preview-container {
        display: flex;
        gap: 8px;
        margin: 16px 0;

        .preview-input {
            flex: 1;
            padding: 10px 12px;
            border: 1px solid #e1e5e9;
            border-radius: 6px;
            font-size: 14px;
            background: #ffffff;

            &::placeholder {
                color: #656d76;
            }
        }

        .preview-button {
            background: #1f883d;
            border: 1px solid #1f883d;
            color: #ffffff;
            padding: 10px 16px;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s ease;

            &:hover {
                background: #1a7f37;
                border-color: #1a7f37;
            }
        }
    }

    .preview-hint {
        font-size: 12px;
        color: #656d76;
        margin: 12px 0 0 0;
        font-style: italic;
    }

    h4 {
        margin: 0 0 16px 0;
        font-size: 18px;
        color: #24292f;
        font-weight: 600;
    }
}