
/* ==========================================
   YEFSATECH - YEFSA AI
   OFFICIAL CYAN / BLUE BRAND THEME
========================================== */

* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;

    --background: #030B20;
    --surface: #07152E;
    --surface-light: #0D2040;
    --surface-hover: #142B50;

    --cyan: #00D9E8;
    --blue: #087BFF;
    --indigo: #493DDF;

    --text: #F5F8FF;
    --muted: #A4B3CC;

    --border: rgba(0, 180, 255, 0.20);
    --gradient: linear-gradient(
        135deg,
        var(--cyan),
        var(--blue),
        var(--indigo)
    );
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background:
        radial-gradient(
            ellipse at 15% 5%,
            rgba(8, 123, 255, 0.17),
            transparent 42%
        ),
        radial-gradient(
            ellipse at 90% 75%,
            rgba(73, 61, 223, 0.13),
            transparent 45%
        ),
        var(--background);
    color: var(--text);
    overflow-x: hidden;
}

/* Ambient background */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        radial-gradient(
            1px 1px at 10% 20%,
            #ffffff60 50%,
            transparent 100%
        ),
        radial-gradient(
            2px 2px at 75% 15%,
            #00D9E860 50%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 40% 70%,
            #087BFF70 50%,
            transparent 100%
        ),
        radial-gradient(
            1px 1px at 85% 85%,
            #ffffff50 50%,
            transparent 100%
        );
    background-size: 320px 320px;
    animation: ambientGlow 9s ease-in-out infinite alternate;
}

@keyframes ambientGlow {
    from {
        opacity: 0.25;
    }
    to {
        opacity: 0.75;
    }
}

[hidden] {
    display: none !important;
}

.app-screen {
    min-height: 100vh;
}

/* ==========================================
   HOME SCREEN
========================================== */

#homeScreen {
    width: 100%;
    max-width: 850px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 50px 22px 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#welcomeGreeting {
    margin: 0 0 35px;
    color: var(--cyan);
    font-size: clamp(27px, 6vw, 36px);
    font-weight: 800;
    letter-spacing: 0.2px;
    text-align: center;
    text-shadow: 0 0 22px rgba(0, 217, 232, 0.25);
}

.home-features {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    justify-content: center;
    align-items: stretch;
}

#openYefsaAiBtn,
#openBmyBtn {
    min-width: 0;
    min-height: 125px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    border-radius: 17px;
    border: 1px solid var(--border);
    transition: 0.25s ease;
}

#openYefsaAiBtn {
    background: linear-gradient(
        145deg,
        #102D55,
        #091A36
    );
    border-color: rgba(0, 217, 232, 0.35);
    box-shadow: 0 8px 25px rgba(8, 123, 255, 0.12);
}

#openBmyBtn {
    background: linear-gradient(
        145deg,
        #152D58,
        #0A1937
    );
    border-color: rgba(73, 61, 223, 0.4);
    box-shadow: 0 8px 25px rgba(73, 61, 223, 0.12);
}

#openYefsaAiBtn:hover,
#openBmyBtn:hover {
    filter: brightness(1.2);
    transform: translateY(-3px);
}

#openYefsaAiBtn strong,
#openBmyBtn strong {
    display: block;
    margin-bottom: 8px;
    font-size: 19px;
    font-weight: 800;
    color: white;
}

#openYefsaAiBtn span,
#openBmyBtn span {
    display: block;
    color: #BDCCE5;
    font-size: 13px;
    line-height: 1.5;
    font-weight: normal;
}

.home-footer {
    margin-top: 45px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 2px;
    text-align: center;
}

/* ==========================================
   APP HEADERS
========================================== */

header,
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;

    background: rgba(3, 11, 32, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom: 1px solid var(--border);
    color: white;
}

header h1,
.app-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--cyan);
    text-shadow: 0 0 15px rgba(0, 217, 232, 0.25);
}

header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

/* Back buttons */

#backHomeFromChatBtn,
#backHomeFromBmyBtn {
    background: rgba(8, 123, 255, 0.12);
    color: white;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
}

/* ==========================================
   BMY SCREEN
========================================== */

.bmy-screen {
    background:
        radial-gradient(
            ellipse at 50% 20%,
            rgba(8, 123, 255, 0.10),
            transparent 55%
        ),
        transparent;
}

.bmy-screen .app-header h1 {
    color: var(--cyan);
}

.bmy-welcome {
    max-width: 650px;
    margin: 70px auto;
    padding: 25px 20px;
    text-align: center;
}

.bmy-welcome h2 {
    color: var(--cyan);
    font-size: 25px;
    margin-bottom: 12px;
}

.bmy-welcome p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

/* ==========================================
   CHAT LAYOUT
========================================== */

.chat-container {
    width: 100%;
    max-width: 850px;
    margin: 15px auto;
    padding: 12px 20px 25px;
}

.chat-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: transparent;
    min-height: 65vh;
    padding: 12px 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.chat-box .message.bot {
    align-self: flex-start;
    margin-left: 0;
    margin-right: auto;
}

.chat-box .message.user {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
}

/* ==========================================
   CHAT MESSAGES
========================================== */

.message {
    width: fit-content;
    max-width: 88%;
    padding: 13px 17px;
    margin: 13px 0;
    border-radius: 17px;
    line-height: 1.7;
    font-size: 16px;
    overflow-wrap: anywhere;
    animation: messageArrival 0.3s ease both;
}

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

/* AI message */

.bot {
    margin-right: auto;
    color: #EAF3FF;
    background: rgba(10, 28, 57, 0.78);
    border: 1px solid rgba(0, 180, 255, 0.18);
    border-bottom-left-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.10);
}

/* User message */

.user {
    display: block;
    width: fit-content;
    max-width: 90%;
    margin-left: auto;
    margin-right: 0;
    color: white;
    background: linear-gradient(
        135deg,
        #087BFF,
        #493DDF
    );
    border: 1px solid rgba(0, 217, 232, 0.22);
    border-bottom-right-radius: 5px;
    box-shadow: 0 5px 20px rgba(8, 123, 255, 0.15);
}

/* Thinking indicator */

.thinking {
    animation: thinkingPulse 1s ease-in-out infinite alternate;
}

@keyframes thinkingPulse {
    from {
        opacity: 0.45;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   CHAT INPUT
========================================== */

.input-area {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding: 9px;

    background: rgba(7, 21, 46, 0.96);
    border: 1px solid rgba(0, 180, 255, 0.28);
    border-radius: 18px;

    box-shadow: 0 0 22px rgba(8, 123, 255, 0.09);
}

input,
textarea {
    font-family: inherit;
}

.input-area input {
    flex: 1;
    min-width: 0;
    padding: 13px 12px;
    border: none;
    outline: none;
    border-radius: 12px;
    background: transparent;
    color: white;
    font-size: 16px;
}

input::placeholder,
textarea::placeholder {
    color: #8499B8;
}

.input-area input:focus {
    outline: none;
}

/* General buttons */

button {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

button:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 16px rgba(8, 123, 255, 0.28);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

/* Developer button */

.developer-btn {
    background: var(--gradient);
    color: white;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
}

/* ==========================================
   HAMBURGER MENU
========================================== */

.menu-container {
    position: relative;
    display: inline-block;
}

.menu-btn {
    background: transparent;
    color: white;
    border: none;
    font-size: 27px;
    cursor: pointer;
    padding: 5px 10px;
    box-shadow: none;
}

.menu-btn:hover {
    background: rgba(8, 123, 255, 0.12);
    box-shadow: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: #091A36;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    overflow: hidden;
}

.dropdown-menu button,
.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: white;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border-radius: 0;
}

.dropdown-menu button:hover,
.dropdown-menu a:hover {
    background: #142B50;
    box-shadow: none;
    transform: none;
}

.dropdown-menu[hidden] {
    display: none !important;
}

/* ==========================================
   CHAT HISTORY
========================================== */

.history-panel {
    position: fixed;
    top: 75px;
    left: 10px;
    right: 10px;
    max-width: 700px;
    max-height: 75vh;
    margin: 0 auto;
    overflow-y: auto;

    background: #07152E;
    color: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    z-index: 3000;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

.history-panel[hidden] {
    display: none !important;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.history-header h2 {
    margin: 0;
    font-size: 19px;
}

.history-header button {
    background: transparent;
    color: white;
    border: none;
    font-size: 22px;
    box-shadow: none;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.history-item {
    background: #0D2040;
    padding: 13px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: white;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.history-item:hover {
    background: #142B50;
}

.history-item small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
}

.history-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-row .history-item {
    flex: 1;
    min-width: 0;
}

.rename-chat-btn,
.delete-chat-btn {
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
}

.rename-chat-btn {
    background: #174C91;
}

.delete-chat-btn {
    background: #922F49;
}

/* ==========================================
   MARKDOWN FORMATTING
========================================== */

.message p {
    margin: 7px 0;
    line-height: 1.7;
}

.message p:first-child {
    margin-top: 0;
}

.message p:last-child {
    margin-bottom: 0;
}

.message strong {
    font-weight: 750;
    color: #FFFFFF;
}

.message em {
    font-style: italic;
}

.message h1,
.message h2,
.message h3 {
    margin: 15px 0 9px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--cyan);
}

.message h1 {
    font-size: 1.4rem;
}

.message h2 {
    font-size: 1.22rem;
}

.message h3 {
    font-size: 1.08rem;
}

.message ul,
.message ol {
    padding-left: 24px;
    margin: 9px 0;
}

.message li {
    margin: 6px 0;
    line-height: 1.6;
}

.message code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(8, 123, 255, 0.15);
    color: #69DFFF;
    font-family: monospace;
    font-size: 0.92em;
}

.message pre {
    padding: 13px;
    border-radius: 9px;
    overflow-x: auto;
    max-width: 100%;
    background: #020817;
    border: 1px solid var(--border);
}

.message pre code {
    padding: 0;
    background: transparent;
    color: #D8E9FF;
}

.message hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

/* ==========================================
   SCROLLBARS
========================================== */

.chat-box,
.history-panel {
    scrollbar-width: thin;
    scrollbar-color: #174C91 transparent;
}

.chat-box::-webkit-scrollbar,
.history-panel::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-thumb,
.history-panel::-webkit-scrollbar-thumb {
    background: #174C91;
    border-radius: 10px;
}

/* ==========================================
   MOBILE RESPONSIVENESS
========================================== */

@media (max-width: 600px) {

    #homeScreen {
        padding: 40px 16px 22px;
    }

    #welcomeGreeting {
        margin-bottom: 28px;
        font-size: 28px;
    }

    .home-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    #openYefsaAiBtn,
    #openBmyBtn {
        min-height: 115px;
        padding: 14px 11px;
    }

    #openYefsaAiBtn strong,
    #openBmyBtn strong {
        font-size: 17px;
    }

    #openYefsaAiBtn span,
    #openBmyBtn span {
        font-size: 12px;
    }

    .home-footer {
        margin-top: 35px;
    }

    .app-header {
        padding: 13px 14px;
    }

    .app-header h1 {
        font-size: 19px;
    }

    .chat-container {
        margin: 10px auto;
        padding: 9px 13px 20px;
    }

    .chat-box {
        min-height: 60vh;
    }

    .message {
        max-width: 92%;
        font-size: 16px;
        padding: 12px 14px;
        margin: 12px 0;
    }

    .input-area {
        gap: 6px;
        padding: 7px;
    }

    .input-area input {
        padding: 12px 8px;
        font-size: 16px;
    }

    .input-area button {
        padding: 11px 14px;
    }

    .history-panel {
        top: 65px;
    }
}

/* Smaller phones */

@media (max-width: 360px) {

    .home-features {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 95%;
    }

    .app-header h1 {
        font-size: 17px;
    }

}

/* ==========================================
   END OF YEFSATECH THEME
========================================== */
