@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: "poppins";
}

:root {
    --dark-color: #09121c;
    --light-color: #ffffff;
    --neutral-color: #939393;
    --background-color: #f6fbff;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    height: 100vh;
    scroll-behavior: smooth;
    text-rendering: optimizeSpeed;
    background-color: #f6fbff;
    color: var(--dark-color);
    padding-top: calc(env(safe-area-inset-top) - 10px);
    -webkit-overflow-scrolling: touch;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
}

ul,
ol {
    list-style: none;
}

main {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 63px);
    overflow-y: auto;
    margin: 0 auto;
    background-color: var(--background-color);
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 90px;
    -webkit-mask-image: -webkit-gradient( linear, left top, left bottom, from(black), color-stop(80%, black), to(transparent) );
    mask-image: linear-gradient( to bottom, black 0%, black 80%, transparent 100% );
    z-index: 1;
}

    main::after {
        content: '';
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 150px;
        background: linear-gradient( to bottom, rgba(246, 251, 255, 0) 0%, rgba(246, 251, 255, 0.8) 50%, rgba(246, 251, 255, 1) 100% );
        pointer-events: none;
        z-index: 999;
    }

/* Tablet view */
@media screen and (min-width: 768px) {
}

.purble-gradient {
    background: var( --linear, linear-gradient(136deg, #8b78ff 0%, #5451d6 101.74%) );
}

.green-gradient {
    background: linear-gradient(136deg, #759979 0%, #0e6325 101.74%);
}

.red-gradient {
    background: linear-gradient(136deg, #b20306 0%, #630e10 101.74%);
}

.floating-nav {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 15px);
    height: 60px;
    border-radius: 16px;
    z-index: 99998;
    overflow: hidden;
    -webkit-box-shadow: 0px 1px 30px -11px rgba(0,0,0,0.15);
    -moz-box-shadow: 0px 1px 30px -11px rgba(0,0,0,0.15);
    box-shadow: 0px 1px 30px -11px rgba(0,0,0,0.15);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    max-width: 400px;
}

.nav-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav__icons {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 16px;
}

.nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    position: relative;
    width: 48px;
    /* height: 66px; */
}

    .nav__link:hover {
        /* background: rgba(74, 39, 194, 0.08); */
    }

    .nav__link.active {
        /* background: rgba(74, 39, 194, 0.08); */
    }

    .nav__link svg {
        width: 24px;
        height: 24px;
        opacity: 0.7;
        transition: opacity 0.3s ease;
    }

    .nav__link:hover svg,
    .nav__link.active svg {
        opacity: 1;
    }

/* Add bottom fade effect */
.floating-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient( to bottom, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100% );
    pointer-events: none;
}

/* For iOS devices, add padding at the bottom to account for the home indicator */
@media screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) {
    .floating-nav {
        bottom: 48px;
    }
}

@media screen and (max-width: 390px) {
    .floating-nav {
        width: calc(100% - 24px);
    }
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    60% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(2px); /* Slight upward movement */
    }

    100% {
        opacity: 1;
        transform: translateY(0); /* Settles back to position */
    }
}

.animate-fade-up {
    opacity: 0;
    animation-name: fadeUp;
    animation-duration: 0.2s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
    -webkit-animation: fadeUp 0.2s ease-out forwards;
    animation: fadeUp 0.2s ease-out forwards;
}

.verification-code-container {
    gap: 15px;
    margin-top: 20px;
    align-items: center;
    flex-direction: row;
}

.verification-code-input {
    position: relative;
    border-radius: 8px;
    width: 60px;
    height: 70px;
    text-align: center;
    font-size: 24px;
    background: white;
    color: black;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

    .verification-code-input:focus {
        transform: scale(1.1);
    }

    .verification-code-input::placeholder {
        color: #FFFFFF;
        opacity: 0.5;
    }

.notification {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 14px;
    white-space: normal;
}

    .notification p {
        margin: 0;
    }

.notification-sending {
    background-color: #f0f4f8; /* Light blue/gray background */
    color: #31708f; /* Darker text */
}

.notification-sent {
    background-color: #dff0d8; /* Light green background */
    color: #3c763d; /* Darker text */
}

.notification-failed {
    background-color: #f2dede; /* Light red background */
    color: #a94442; /* Darker text */
}
/* Updated .group-button-container to include separators */
.group-button-container {
    position: relative; /* Positioning context for the slider */
    display: flex;
    gap: 0; /* Remove gap to prevent spacing issues */
    padding: 0; /* Remove padding to align buttons correctly */
    justify-content: flex-start; /* Align buttons to the start */
    align-items: stretch; /* Stretch buttons to match container height */
    border-radius: 0.5rem;
    background: #F9F8FF;
    overflow: hidden;
}



/* Slider Styling */
.slider {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--my-color, linear-gradient(180deg, #4B27C2 0%, #815CE9 100%));
    border-radius: 0.375rem;
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
    z-index: 0;
    pointer-events: none;
}

.group-button-container .group-button {
    position: relative;
    z-index: 1;
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    color: #3C3C43;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-size: 1rem;
    background-color: transparent;
}



.group-button.active {
    color: white;
}

.group-button.inactive {
    color: #3C3C43;
}

/* Add this at the end of the file */
.modal {
    display: none !important;
}

.modal-backdrop {
    display: none !important;
}

.modal-dialog {
    display: none !important;
}



/* 🆕 Add new selection button styles */
.selection-button {
    padding: 0.5rem 1rem;
    color: var(--neutral-color);
    cursor: pointer;
    border-radius: 11px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

    .selection-button.active {
        color: var(--light-color);
        background: linear-gradient(271deg, #4925c1 1.64%, #7953e9 102.71%);
        box-shadow: 0 2px 4px rgba(73, 37, 193, 0.2);
    }

    .selection-button:hover:not(.active) {
        background: rgba(74, 39, 194, 0.08);
    }

/* 🎨 Responsive Design */
@media (max-width: 768px) {
    .selection-button {
        font-size: 0.9rem;
        padding: 0.5rem 1.2rem;
    }
}

/* 🆕 Add selection buttons container */
.selection-buttons-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap; /* Mobile: prevent wrapping */
}

    .selection-buttons-container::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    .editor-magic-panel:before{
        content:'';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1;
        backdrop-filter: blur(20px);
    }
    
.editor-magic-panel {
    position: fixed;
    bottom: 87px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    height: 3rem;
    border-radius: 16px 16px 0 0;
    z-index: 99990;
    /* backdrop-filter: blur(5px); */
    overflow: hidden;
    -webkit-box-shadow: 0px 1px 30px -11px rgba(0,0,0,0.15);
    -moz-box-shadow: 0px 1px 30px -11px rgba(0,0,0,0.15);
    box-shadow: 0px 1px 30px -11px rgba(0,0,0,0.7);
    background: linear-gradient(154deg, #ffffff, #f0ecff38);
    transition: height 0.1s;
}

.editor-magic-panel-header {
    background: linear-gradient(271deg, #4925C1 1.64%, #7953E9 102.71%);
    display: flex;
    /* height: 20rem; */
    padding: 0.75rem 1rem;
    justify-content: center;
    align-items: start;
    gap: 0.625rem;
    flex-shrink: 0;
    position: relative;
    color: var(--light-color);
}

.editor-magic-panel-header-close {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    transition: transform 0.3s ease-in-out;
}

.editor-magic-panel-header-close.expanded {
        transform: rotate(180deg);
}

.editor-magic-panel.expanded {
    height: 83vh;
    bottom: 78px;
}
.editor-magic-panel-content{
    /* padding: 1rem; */
}

/* 🎯 Category Section Styles */
/* .category-section {
    margin: 1rem 0;
    border-radius: 8px;
    background: #f5f5f5;
    padding: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-section .section-title {
    cursor: pointer;
    padding: 0.5rem;
    font-weight: 600;
    display: flex;
    gap: 5px;
    align-items: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--dark-color);
}

.category-section .section-title:hover {
    background: #f0f0f0;
}

.category-section .section-title .arrow-icon {
    transition: transform 0.2s ease;
    color: var(--neutral-color);
}

.category-section .section-title .toggle-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.category-section .section-title .add-button,
.category-section .section-title .remove-button {
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.category-section .section-title .add-button {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.category-section .section-title .add-button:hover {
    background: #43A047;
    transform: scale(1.05);
}

.category-section .section-title .add-button:active {
    transform: scale(0.95);
}

.category-section .section-title .remove-button {
    background: #bf1306;
    color: white;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.category-section .section-title .remove-button:hover {
    background: #E53935;
    transform: scale(1.05);
}

.category-section .section-title .remove-button:active {
    transform: scale(0.95);
}


.category-section .section-title.expanded .remove-button {
    display: flex;
}

.category-section .subsection {
    margin-top: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
}

.category-section .subsection .subtitle {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-section .subsection .options-grid {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.25rem;
}

.category-section .subsection .options-grid .option {
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    color: var(--dark-color);
    border-radius: 8px;
}

.category-section .subsection .options-grid .option:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-section .subsection .options-grid .option:active {
    transform: translateY(0);
}

.category-section .subsection .options-grid .option.selected {
    background: linear-gradient(271deg, #4925c1 1.64%, #7953e9 102.71%);
    color: white;
    border-color: transparent;
}

 
@media (max-width: 768px) {
    .category-section {
        margin: 0.5rem 0;
    }
    
    .category-section .subsection .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.25rem;
    }
    
    .category-section .subsection .options-grid .option {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
} */

/* 🎯 MegaGroup Styles */
.mega-group-container {
    width: 100%;
    /* max-width: 800px; */
    margin: 0 auto;
    overflow-y: auto;
    /* max-height: 64vh; */
}

.section {
    margin: 1rem 0;
    border-radius: 8px;
    background: linear-gradient(170deg, #f3f3f3, #efecff);
    padding: 0.1rem 0.25rem;
    box-shadow: 0 2px 1px rgba(0, 0, 0, 0.025);
    transition: all 0.1s;
}

.section-header {
    cursor: pointer;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.subsection {
    margin: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    display: flex;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.subsection-header {
    CONTAIN-INTRINSIC-BLOCK-SIZE: AUTO 100PX;
    padding: 0rem 0.4rem 0rem 0rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.options-grid {
    display: flex;
    /* grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); */
    gap: 0.5rem;
    margin: 0.5rem 0;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-content: center;
    font-size: 0.9rem;
}

.option {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    /* height: 40px; */
    max-height: fit-content;!;!i;!;
}

.option:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.option.selected {
    background: linear-gradient(271deg, #4925c1 1.64%, #7953e9 102.71%);
    color: white;
    border-color: transparent;
}

/* 🎯 Modern Glow Toggle Buttons */
.toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
    overflow: hidden;
    border-radius: 8px;
    color: var(--light-color);
}

.add-button {
    background: linear-gradient(145deg, #4CAF50 0%, #66BB6A 100%);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4),
                0 0 16px rgba(102, 187, 106, 0.3);
    color: var(--background-color);
}

.add-button::before,
.add-button::after {
    /* content: ''; */
    position: absolute;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.add-button::before {
    width: 2px;
    height: 14px;
}

.add-button::after {
    width: 14px;
    height: 2px;
}

.add-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.6),
                0 0 24px rgba(102, 187, 106, 0.4);
}

.add-button:active {
    transform: scale(0.95);
}

.remove-button {
    background: linear-gradient(145deg, #b30c00 0%, #f3130e 100%);
    box-shadow: 0 0 4px rgba(244, 67, 54, 0.4),
                0 0 16px rgba(239, 83, 80, 0.1);
    color: white;
}

.remove-button::before {
    /* content: ''; */
    position: absolute;
    width: 14px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.remove-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(244, 67, 54, 0.6),
                0 0 24px rgba(239, 83, 80, 0.4);
}

.remove-button:active {
    transform: scale(0.95);
}

/* 🎯 Neon Glow Animation */
@keyframes glow {
    0% {
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.4),
                    0 0 16px rgba(102, 187, 106, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(76, 175, 80, 0.6),
                    0 0 24px rgba(102, 187, 106, 0.4);
    }
    100% {
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.4),
                    0 0 16px rgba(102, 187, 106, 0.3);
    }
}

.button-glow-animation {
    animation: glow 2s infinite ease-in-out;
}

/* 🌀 Loading Panel Styles */
.loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    gap: 1rem;
 
    border-radius: 16px;
    /* backdrop-filter: blur(12px); */
    -webkit-backdrop-filter: blur(12px);
    margin: 1rem;
    padding: 2rem;
 
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4B27C2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.2rem;
    color: #3C3C43;
    text-align: center;
    transition: opacity 0.3s ease;
    font-weight: 500;
    font-size: 0.8rem;
    animation: text-fade 1s;
}

@keyframes text-fade {
 
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🌀 Loading Spinner Styles */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4B27C2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* 🎯 Add specific styles for the ⌛ loading indicator */
.option.action-button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 40px;
    padding: 0.5rem;
}

.option.action-button.loading::before {
    content: '⌛';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotateHourglass 1.5s infinite ease-in-out;
}

@keyframes rotateHourglass {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

 
/* 🎯 Add specific styles for generate/rewrite buttons */
.section-actions .generate-button {
    color: #4CAF50;
}

.section-actions .rewrite-button {
    color: #4B27C2;
}

.section-actions .generate-button:hover {
    background: rgba(76, 175, 80, 0.1);
}

.section-actions .rewrite-button:hover {
    background: rgba(75, 39, 194, 0.1);
}

/* 🆕 Add subsection actions container */
.subsection-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.subsection-action {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-height: 40px;
}

.subsection-action:hover {
    background: rgba(74, 39, 194, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.subsection-action:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subsection-action.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.subsection-action.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

.subsection-action.primary.loading::before {
    border-top-color: white;
}

.subsection-action.secondary.loading::before {
    border-top-color: var(--dark-color);
}

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

.subsection-action.primary {
    background: linear-gradient(271deg, #4925c1 1.64%, #7953e9 102.71%);
    color: white;
    border-color: transparent;
}

.subsection-action.secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark-color);
}



.section-actions .action-button.loading {
    pointer-events: none;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.section-actions .action-button.loading::before {
    content: '⌛';
    animation: rotateHourglass 1.5s infinite ease-in-out;
}
 
/* Mega Group specific loading styles */
.mega-group-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    animation: mega-group-fadeIn 0.3s ease;
}

@keyframes mega-group-fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.mega-group-loading-spinner {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.mega-group-spinner-circle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #7953e9;
    animation: mega-group-loading-spinner 1.2s linear infinite;
    left: 19px;
}

.mega-group-spinner-circle:nth-child(1) {
    left: 8px;
    animation-delay: 0s;
}

.mega-group-spinner-circle:nth-child(2) {
    left: 32px;
    animation-delay: 0.2s;
}

.mega-group-spinner-circle:nth-child(3) {
    left: 52px;
    animation-delay: 0.4s;
}

@keyframes mega-group-loading-spinner {
    0%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

.mega-group-loading-text {
    font-size: 0.9rem;
    color: var(--neutral-color);
    animation: mega-group-text-fade 1s infinite alternate;
}

/* 🎨 Writing Style Options Panel */
.writing-options-panel {
    background: var(--Bg, linear-gradient(180deg, #FFF 0%, #F8F6FF 100%));
    box-shadow: 0px 0px 10px 0px rgba(172, 153, 226, 0.1);
    border-radius: 16px;
    padding: 0;
    margin: 1rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.writing-options-toggle {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.writing-options-toggle .toggle-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--neutral-color);
    flex-shrink: 0;
}

.writing-options-toggle .toggle-arrow.open {
    transform: rotate(-180deg);
}

.writing-options-content {
    padding: 0 1rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* max-height: 33px; */
    /* opacity: 0; */
}

.writing-options-panel.expanded .writing-options-content {
    max-height: 500px;
    opacity: 1;
}

.writing-options-panel.collapsed .writing-options-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Update existing writing options styles to work with new structure */
.writing-options-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-bottom: 1rem;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
}

.writing-option-label {
    font-size: 0.875rem;
    color: var(--dark-color);
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    display: block;
}

/* Style Option Buttons */
.style-option-button {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid transparent;
    color: var(--neutral-color);
    cursor: pointer;
    transition: all 0.3s ease, border-color 0.2s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.style-option-button.active {
    border: 1px solid #4925c126;
    border-image-slice: 1;
    background: linear-gradient(to bottom right, 
        rgba(73, 37, 193, 0.05) 0%, 
        rgba(121, 83, 233, 0.05) 100%);
    color: #4925c1;
    position: relative;
    border-radius: 100px;
}

.style-option-button.active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(271deg, #4925c1 1.64%, #7953e9 102.71%);
    z-index: -1;
    border-radius: inherit;
    opacity: 0.15;
}

.style-option-button:hover:not(.active) {
    border-color: rgba(73, 37, 193, 0.3);
}

/* Action Buttons */
.writing-action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.writing-action-button {
    flex: 1;
    padding: 0.5rem;
    border-radius: 15px;
    font-size: 0.9rem;
    /* font-weight: 500; */
    color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.writing-action-button.primary {
    background: linear-gradient(271deg, #4925c1 1.64%, #7953e9 102.71%);
}

.writing-action-button.secondary {
    background: linear-gradient(271deg, #759979 0%, #0e6325 101.74%);
}

.writing-action-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.writing-action-button:active {
    transform: translateY(0);
}

/* Loading State */
.writing-action-button.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.writing-action-button.loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Approach Description Styles */
.approach-description {
    /* margin-top: 4px; */
    /* min-height: 24px; */
    /* text-align: center; */
    /* padding: 0.5rem 1rem; */
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(170deg, #f3efef, #e3e2e538);
    border-radius: 7px;
    /* transform: scale(1); */
    /* font-size: 9px; */
}

.hint-text {
    color: var(--neutral-color);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: fadeIn 0.3s ease-in-out;
    font-weight: 400;
    /* background: linear-gradient(170deg, #f3efef, #e3e2e538); */
    padding: 0.5rem 1rem;
    /* border-radius: 8px; */
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02); */
    /* backdrop-filter: blur(4px); */
    font-size: 0.8rem;
}

.hint-text::before {
    content: "💡";
    font-size: 1rem;
}

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

/* Tools Page Styles */
.tools-page {
    min-height: 100vh;
    background-color: #fafafa;
    padding-bottom: 80px;
}

.tools-header {
    background: linear-gradient(180deg,  #4B27C2 1.64%, #7953e9 102.71%);
    padding: 2rem 1.5rem 5rem;
    color: white;
    position: relative;
    height: 219px;
}

.tools-header__content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tools-header__title {
    margin-bottom: 2rem;
    /* text-align: center; */
}

.tools-header__title h1 {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.tools-header__title p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

/* Tools Search Styles */
.tools-header__search .search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.tools-header__search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

.tools-header__search .search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.tools-header__search .search-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.tools-header__search .search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
}

/* Tools Container Styles */
.tools-container {
    max-width: 1100px;
    /* margin: -3rem auto 0; */
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.tools-filter {
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.tools-filter__buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
    /* justify-content: center; */
}

/* Search Results Styles */
.tools-container .search-results {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    text-align: center;
}

.tools-container .search-results p {
    margin: 0;
    color: #4a5568;
    font-size: 1rem;
}

.tools-container .search-results strong {
    color: #4A27C2;
}

/* Tools Grid Styles */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Tools Page Responsive Styles */
@media (max-width: 768px) {
    .tools-header {
        padding: 1.5rem 1rem 4rem;
    }

    .tools-header__title h1 {
        /* font-size: 2rem; */
    }

    .tools-header__title p {
        /* font-size: 0.8rem; */
    }

    .tools-container {
        padding: 1rem;
        /* margin-top: -2rem; */
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Dropdown Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 10000;
}

.dropdown-trigger {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #ffffff, #f8f6ff);
    border: 1px solid rgba(73, 37, 193, 0.1);
    color: var(--dark-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    min-width: 200px;
    /* width: 106%; */
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.dropdown-trigger:hover {
    border-color: rgba(73, 37, 193, 0.2);
    background: linear-gradient(to bottom right, #ffffff, #f0ebff);
}

.dropdown-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--neutral-color);
    flex-shrink: 0;
}

.dropdown-arrow.open {
    transform: rotate(-180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px) !important;
    left: 0;
    right: auto;
    min-width: 210px;
    transform: none !important;
    margin-top: 4px;
    z-index: 10001;
    display: block !important;
    opacity: 1 !important;
    visibility: visible;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    border: 1px solid rgba(73, 37, 193, 0.1);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}

.dropdown-item:hover {
    background: rgba(73, 37, 193, 0.05);
}

.dropdown-item.active {
    background: linear-gradient(271deg, rgba(73, 37, 193, 0.1) 1.64%, rgba(121, 83, 233, 0.1) 102.71%);
    color: #4925c1;
    font-weight: 500;
}

/* Update settings options container */
.settings-options {
    position: relative;
    z-index: 9999;
}

/* Remove transform scale from the container */
.settings-options.d-flex {
    position: static;
    transform: none !important;
    z-index: auto;
}

/* Add styles to ensure proper positioning */
.form__field {
    position: relative;
    z-index: auto;
    overflow: visible !important;
}

/* Highlight style for searched matched text */
.search-highlight {
    background-color: rgba(139, 120, 255, 0.3); /* light purple highlight */
}

/* Add this to the existing CSS */
.editor-container {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 5px minmax(200px, 0.5fr);
    gap: 0;
}

.message-input {
    min-height: 300px;
    height: auto;
    resize: vertical;
}

@media (max-width: 767px) {
    .editor-container {
        display: block;
    }
    
    .editor-right {
        position: static;
        height: auto;
        margin-top: 2rem;
    }
    
    .message-input {
        min-height: 150px;
        rows: 4; /* Override HTML attribute with CSS */
        height: auto;
    }
}

@media (min-width: 768px) {
    .editor-container {
        display: grid;
        grid-template-columns: 1fr 5px 1fr;
        gap: 0 8px;  /* 0 for vertical gap, 8px for horizontal gap */
    }
    
    .editor-left {
        min-width: 300px;
        padding-right: 4px;  /* Additional padding for visual comfort */
    }
    
    .editor-right {
        min-width: 200px;
        padding-left: 4px;   /* Additional padding for visual comfort */
    }
    
    .editor-right {
        position: sticky;
        top: 1rem;
        height: fit-content;
    }
    
    .message-input {
        min-height: 500px;
        height: auto;
    }
}

@media (min-width: 768px) {
    .selection-buttons-container {
        flex-wrap: wrap; /* Desktop: allow wrapping */
        overflow-x: visible;
    }
}

.editor-splitter {
    background: #e0e0e0;
    cursor: ew-resize;
    width: 5px;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    transition: background 0.2s ease;
    border-radius: 2px;
    margin: 0 -4px;  /* Negative margin to compensate for the padding */
}

.editor-splitter:hover {
    background: #4925c1;
}

.editor-splitter.resizing {
    background: #7953e9;
    box-shadow: 0 0 8px rgba(73, 37, 193, 0.3);
}

/* Add visual handles to indicate draggable */
.editor-splitter::before,
.editor-splitter::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: #fff;
    border-radius: 1px;
}

.editor-splitter::before {
    top: calc(50% - 12px);
}

.editor-splitter::after {
    top: calc(50% + 12px);
}

.editor-mode-selector {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 1rem;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.mode-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 0.95rem;
    width: 130px;  /* Fixed width for each button */
    text-align: left;
    justify-content: center;
}

.mode-button:hover {
    background: rgba(73, 37, 193, 0.05);
    color: #4925c1;
}

.mode-button.active {
    background: linear-gradient(271deg, #4925C1 1.64%, #7953E9 102.71%);
    color: white;
}

.mode-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.mode-button .mode-icon {
    margin-right: 4px;  /* Add some space between icon and text */
}

@media (max-width: 767px) {
    .editor-mode-selector {
        flex-direction: row;
        padding: 4px;
    }
    
    .mode-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Magic Panel Selector Styles */
.magic-panel-selector {
    display: flex;
    flex-wrap: wrap;
    overflow-x: auto;
    gap: 8px;
    margin: 1rem 0;
    padding: 4px 0;
    justify-content: flex-start;
}

.magic-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 150px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    justify-content: center;
}

.magic-button:hover {
    background: rgba(74, 39, 194, 0.08);
}

.magic-button.active {
    background: linear-gradient(271deg, #4925C1 1.64%, #7953E9 102.71%);
    color: white;
}

@media (max-width: 768px) {
    .magic-panel-selector {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .magic-panel-selector::-webkit-scrollbar {
        display: none;
    }
    
    .magic-button {
        font-size: 0.9rem;
        padding: 8px 12px;
        flex-shrink: 0;
        min-width: auto;
    }

    .loading-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 200px;
        width: 100%;
        padding: 2rem;
    }
}
