body {
    margin: 0;
    font-family: 'Vazirmatn', sans-serif;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: linear-gradient(45deg,rgba(47, 31, 104, 1) 0%, rgba(9, 15, 29, 1) 53%, rgba(25, 29, 67, 1) 100%);
}
p#hint
{
    margin: 2px auto 0;
    font-size: .9rem ;
    color: #bebebe;
}
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,rgba(47, 31, 104, 1) 0%, rgba(9, 15, 29, 1) 53%, rgba(25, 29, 67, 1) 100%);
    /* Darker gradient for particles background */
    z-index: -1;
}

.container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* --- Shared Styles --- */
.header-icon {
    position: absolute;
    width: fit-content;
    height: 30px;
    border-radius: 50%;
    /* background-color: rgba(255, 255, 255, 0.1); */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.header-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.top-right {
    top: 20px;
    right: 20px;
}


/* --- Landing Page --- */
.landing-page {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.landing-page.active {
    display: flex;
    opacity: 1;
}

.title {
    font-size: 3.5em;
    font-weight: 700;
    color: #a7f0ba;
    /* Neon Green */
    text-shadow: 0 0 15px rgba(167, 240, 186, 0.6);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    color: #b0c4de;
    /* Light Grayish Blue */
    margin-bottom: 40px;
}

#audioVisualizer {
    margin-bottom: 50px;
    filter: drop-shadow(0 0 10px rgba(135, 206, 235, 0.5));
    /* Light blue glow */
}

.cta-button {
    background: linear-gradient(90deg, #8a2be2, #00bfff);
    /* Purple to Blue */
    border: none;
    border-radius: 30px;
    color: white;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 191, 255, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 191, 255, 0.6);
}

.footer-icons {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.footer-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.footer-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}


/* --- Chat Page --- */
.chat-page {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;

    /* Semi-transparent background */

    /* Frosted glass effect */
    border-radius: 20px;
    padding: 20px;

    opacity: 0;
    position: relative;
    
}



.chat-page.active {
    display: flex;
    opacity: 1;
}

.chat-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.chat-header h2 {
    font-size: 2em;
    color: #a7f0ba;
    margin: 0;
}

.voice-switch-bar {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.voice-switch-bar .voice-switch {
    pointer-events: auto;
}

.voice-switch {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 7px 12px 7px 10px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    z-index: 5;
}

.voice-switch-bar .voice-switch {
    position: static;
    inset-inline-start: unset;
    top: unset;
    transform: none;
}

.voice-switch:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(167, 240, 186, 0.45);
    box-shadow: 0 0 16px rgba(0, 191, 255, 0.15);
}

.voice-switch.voice-on {
    border-color: rgba(0, 255, 153, 0.35);
}

.voice-switch.voice-off {
    border-color: rgba(255, 107, 107, 0.35);
}

.voice-switch-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: #e8fff0;
    white-space: nowrap;
}

.voice-switch-icon {
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.voice-switch-icon-on {
    color: #00ff99;
}

.voice-switch-icon-off {
    color: #ff8a8a;
    display: none;
}

.voice-switch.voice-off .voice-switch-icon-on {
    display: none;
}

.voice-switch.voice-off .voice-switch-icon-off {
    display: block;
}

.voice-switch.voice-off .voice-switch-text {
    color: #ffd4d4;
}

.voice-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.voice-switch-track {
    width: 42px;
    height: 22px;
    border-radius: 11px;
    background: rgba(255, 107, 107, 0.35);
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.voice-switch input:checked + .voice-switch-track {
    background: linear-gradient(135deg, #00ff99, #00bfff);
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.35);
}

.voice-switch-thumb {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: inset-inline-start 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.voice-switch input:checked + .voice-switch-track .voice-switch-thumb {
    inset-inline-start: calc(100% - 20px);
}

.chat-box {
    height: 100%;
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    margin: 0 10px;
    /* Custom scrollbar for modern look */
    scrollbar-width: thin;
    scrollbar-color: #892be272 #3333336e;
    animation: popup .5s forwards;
}
.text-chat
{
    background: #ffffff;
    background: linear-gradient(45deg, rgba(98, 98, 98, 0.2) 0%, rgba(101, 101, 101, 0.2) 53%, rgba(158, 158, 158, 0.2) 100%);
    border: solid 1px #ffffff6a;
    box-shadow: 3px 3px 10px 1px #00000052 , inset 3px 3px 10px 1px #89898952;
    border-radius: 20px;
    backdrop-filter: blur(7px);
    width: 100%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-box::-webkit-scrollbar {
    
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background: #333;
    border-radius: 10px;
    
}

.chat-box::-webkit-scrollbar-thumb {
    background-color: #8a2be2;
    border-radius: 10px;
    border: 2px solid #333;
}

.message {
    max-width: 50%;
    width: fit-content;
    padding: 12px 18px;
    border-radius: 20px;
    margin-bottom: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    background: linear-gradient(135deg, #00bfff, #87ceeb);
    /* Light blue for user */
    color: #000;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    /* Tail for user message */
}

.message.ai {
    background: linear-gradient(135deg, #8a2be2, #4b0082);
    /* Purple for AI */
    color: #fff;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    /* Tail for AI message */
}

#chatVisualizer {
    display: block;
    margin: 20px auto;
    /* filter: drop-shadow(0 0 8px rgba(0, 191, 255, 0.4)); */
    

}

.chat-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 5px auto;
}

.mute-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: solid #ff6b6b;
    background: none;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5), inset 0 0 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.mute-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.8);
}

.mic-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: solid #00bfff;
    background: none;
    /* Dynamic gradient */
    /* border: none; */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 0;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.6) , inset 0 0 20px rgba(0, 191, 255, 0.6);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.mic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.8);
}

.mic-button.active {
    animation: pulse 1.5s infinite ease-out;
    /* Pulsing animation when active */
}

.mic-icon {
    width: 30px;
    height: 30px;
    background-color: #333;
    border-radius: 50%;
    position: relative;
}

.mic-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 25px;
    background-color: #fff;
    border-radius: 5px;
}

.mic-icon::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 5px;
    background-color: #fff;
    border-radius: 3px;
}
footer
{
    height: 10px;
    direction: ltr;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.6) , inset 0 0 20px rgba(0, 191, 255, 0.6);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 40px rgba(0, 191, 255, 0.9) , inset 0 0 40px rgba(0, 191, 255, 0.9);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.6) , inset 0 0 20px rgba(0, 191, 255, 0.6);
    }
}
@keyframes popup {
    0% {
        height: 50%;
        opacity: 0;
    }

    100% {
        height: 90%;
        opacity: 1;
    }
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .title {
        font-size: 2.5em;
    }

    .subtitle {
        font-size: 1em;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }

    .footer-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
    }

    .top-right {
        top: 10px;
        right: 10px;
    }

    .chat-header h2 {
        font-size: 1.5em;
    }

    .voice-switch-bar {
        top: 10px;
        max-width: calc(100% - 24px);
    }

    .voice-switch-bar .voice-switch {
        padding: 6px 10px;
    }

    .voice-switch-text span {
        font-size: 0.9em;
    }
}