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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    color: #fafafa;
}

body {
    background-repeat: no-repeat;
    background: linear-gradient(180deg, #012e40 10%, #011c26 50%, #00080d 100%);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.background-layers {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}
    
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 164px 164px;
    width: 100%;
    height: 100%;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

header {
    padding: 20px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 24px;
}

.logo h1 {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.desktop-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
}

.desktop-menu li {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.desktop-menu li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    padding: 0.5rem 0.8rem;
    display: block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.desktop-menu li a:hover {
    opacity: 0.5;
}

.desktop-menu li .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(20, 20, 40, 0.9);
    padding: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 160px;
    z-index: 100;
}

.desktop-menu li.has-submenu:hover .submenu {
    display: block;
}

.desktop-menu li .submenu li {
    display: block;
    width: 100%;
}

.desktop-menu li .submenu li a {
    padding: 0.5rem 1rem;
    color: white;
    white-space: nowrap;
}

desktop-menu li .submenu li a:hover {
    opacity: 0.5;
}

.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.burger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #011c26;
    backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 80px 20px 20px;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-overlay .logo {
    position: absolute;
    top: 24px;
    left: 20px;
    z-index: 1001;
}

.mobile-menu-overlay.active .logo {
    opacity: 1;
}

.mobile-menu-overlay.active .logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.mobile-menu-overlay .logo i {
    font-size: 24px;
}

.mobile-menu-overlay .logo h1 {
    font-size: 24px;
}

.mobile-menu-content {
    margin: 0 auto;
}

.mobile-menu-section,
.mobile-menu-single {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active .mobile-menu-section,
.mobile-menu-overlay.active .mobile-menu-single {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-overlay.active .mobile-menu-section:nth-child(1),
.mobile-menu-overlay.active .mobile-menu-single:nth-child(1) {
    transition-delay: 0.05s;
}
.mobile-menu-overlay.active .mobile-menu-section:nth-child(2),
.mobile-menu-overlay.active .mobile-menu-single:nth-child(2) {
    transition-delay: 0.06s;
}
.mobile-menu-overlay.active .mobile-menu-section:nth-child(3),
.mobile-menu-overlay.active .mobile-menu-single:nth-child(3) {
    transition-delay: 0.07s;
}
.mobile-menu-overlay.active .mobile-menu-section:nth-child(4),
.mobile-menu-overlay.active .mobile-menu-single:nth-child(4) {
    transition-delay: 0.08s;
}

.mobile-menu-section h3 {
    color: white;
    font-size: 18px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: normal;
}

.mobile-menu-section h3 i {
    transition: transform 0.3s ease;
    padding: 10px;
}

.mobile-menu-section.expanded h3 i {
    transform: rotate(180deg);
}

.mobile-menu-items {
    display: none;
    padding-top: 10px;
    list-style: none;
}

.mobile-menu-section.expanded .mobile-menu-items {
    display: block;
}

.mobile-menu-items a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 12px 0;
    font-size: 16px;
    transition: all 0.3s ease;
}

.mobile-menu-items a:hover,
.mobile-menu-section h3:hover {
    color: white;
    padding-left: 5px;
    opacity: 0.5;
}

.mobile-menu-single a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu-single a:hover {
    padding-left: 5px;
    opacity: 0.5;
}

.profile {
    width: 160px;
    height: auto;
    display: block;
    background: transparent;
    color: #fff;
    border: 1px solid #ffffff61;
    border-radius: 15px;
    box-shadow: 0px 0px 7px #a5a8b496;
    padding: 10px 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    text-align: center;
}

.profile::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: 0.6s;
}

.profile:hover {
    border: 1px solid #ffffff;
    box-shadow: 0px 0px 10px #a5a8b4cc;
}

.profile:hover::before {
    left: 100%;
}

.profile:active {
    transform: translateY(1px);
    box-shadow: 0px 0px 5px #a5a8b496;
}

.mobile-profile {
    margin-top: 40px;
    text-align: center;
}

.mobile-profile .profile {
    width: 100%;
    max-width: 300px;
}

main {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.exercise {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
}

.description {
    margin: 60px 40px 10px 30px;
    max-width: 1100px;
    color: #fafafa;
    align-items: start;
    text-align: left;
    position: relative;
}

.description h2 {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    font-style: italic;
    text-align: left;
}

.text {
    display: flex;
    margin: 0 0 20px 0;
    margin-bottom: 20px;
}

.text p {
    font-size: clamp(18px, 3vw, 24px);
    margin: 20px 0;
    color: #B5B7BA;
}

.text span {
    font-size: clamp(20px, 3.5vw, 28px);
    margin: 20px 5px;
    padding: 0 5px;
    color: #00B6FF;
    font-weight: 500;
}

.write {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: #B5B7BA;
    background: transparent;
    width: 100%;
    height: auto;
    max-width: 800px;
    position: static;
    padding: 10px 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    position: relative;
}

.write-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.write input {
    display: block;
    background: transparent;
    color: #B5B7BA;
    border: 1px solid #B5B7BA;
    border-radius: 70px;
    width: 100%;
    font-size: clamp(18px, 3vw, 30px);
     padding: 10px 50px 10px 20px; 
    outline: none;
}

.write .send {
    background: transparent;
    border: none;
    color: #B5B7BA;
    font-size: clamp(20px, 3vw, 30px);
    transition: transform 0.3s ease;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 25%;
    transform: translateY(- 50%);
    z-index: 1;
}

.send:active {
    transform: scale(0.95);
}

.write .send:hover {
    transform: rotate(50deg);
}

.result {
    overflow-y: auto;
    scroll-behavior: smooth; 
    padding-bottom: 15px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    height: auto;
    overflow-y: auto;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.user-msg, .bot-msg {
    padding: 10px 12px;
    border-radius: 8px;
    width: fit-content;
    max-width: 90%;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-in;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.error-msg {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 3px solid #ff0000;
}

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

.user-msg {
    align-self: flex-end;
    background-color: #0078d7;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-msg {
    background-color: rgba(68, 68, 68, 0.8);
    color: #fff;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.bot-msg strong {
    color: #00B6FF;
    font-weight: 600;
}

.continue-options {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.continue-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-weight: 500;
}

.continue-btn.yes {
    background-color: #00B6FF;
}

.continue-btn.no {
    background-color: #666;
}

.continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    color: #615e5e44;
    font-size: 14px;
    z-index: 10;
}

footer p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.603);
    text-align: center;
    bottom: 0;
    padding: 20px;
}

.chat-container::-webkit-scrollbar {
    width: 10px;
}

.chat-container::-webkit-scrollbar-track {
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #3a3a3a63; 
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a63;
}

@media (max-width: 992px) {
    .description {
        margin-top: 60px;
        margin-bottom: 10px;
    }
    
    .write {
        margin: 0 auto 2rem;
    }
}

@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }

    .burger-menu {
        display: flex;
    }

    .profile {
        display: none;
    }

    .mobile-profile > .profile {
        display: block;
        margin: auto;
    }

    nav {
        justify-content: space-between;
    }

    nav ul {
        justify-content: center;
        padding: 10px 0;
    }
}

@media (max-width: 576px) {
    nav ul {
        gap: 10px;
    }

    nav ul li a {
        font-size: 16px;
        padding: 0.5rem;
        text-align: center;
    }

    .profile {
        width: 120px;
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .write {
        margin: 0rem auto 2rem;
        width: 90%;
    }
    
    .write input {
        padding: 8px 15px 8px 20px;
    }

    .description {
        margin-bottom: 10px
    }
        
    .description h2 {
        text-align: left;
    }
    
    .text p {
        justify-content: flex-start;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #011C26 0%, #00080D 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: #012E40;
    border-radius: 10px;
    border: 2px solid #00080D;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #01475F;
}

* {
    scrollbar-color: #012E40 #00080D;
}