/* =====================================================
   YUSUFAI - STYLE.CSS
===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #070b14;
    --panel: #0d1422;
    --panel-2: #111b2d;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f5f7fb;
    --muted: #9aa7ba;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --danger: #ef4444;
    --user: #4f46e5;
    --ai: #172235;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
}


/* =====================================================
   GENEL
===================================================== */

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.screen {
    width: 100%;
    height: 100dvh;
}


/* =====================================================
   OCEAN / ARKA PLAN
===================================================== */

#ocean {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(59, 130, 246, 0.12),
            transparent 35%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(99, 102, 241, 0.10),
            transparent 35%
        ),
        var(--bg);
}

.fish {
    position: fixed;
    left: -100px;

    font-size: 28px;

    opacity: 0.25;

    animation:
        fishMove linear forwards;

    white-space: nowrap;
}

@keyframes fishMove {

    0% {
        transform:
            translateX(-120px)
            translateY(0);
    }

    50% {
        transform:
            translateX(55vw)
            translateY(var(--wave));
    }

    100% {
        transform:
            translateX(110vw)
            translateY(0);
    }
}


/* =====================================================
   AUTH
===================================================== */

#authScreen {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.auth-container {
    width: min(430px, 100%);

    padding: 35px 25px;

    text-align: center;

    background:
        rgba(13, 20, 34, 0.88);

    border: 1px solid var(--border);

    border-radius: 25px;

    box-shadow:
        0 25px 80px
        rgba(0, 0, 0, 0.4);

    backdrop-filter: blur(18px);
}

.logo {
    width: 80px;
    height: 80px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;

    border-radius: 24px;

    font-size: 42px;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #8b5cf6
        );

    box-shadow:
        0 15px 40px
        rgba(99, 102, 241, 0.35);
}

.auth-container h1 {
    font-size: 32px;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 25px;
}

.auth-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-box h2 {
    margin-bottom: 5px;
}

.auth-box input {
    width: 100%;

    padding: 14px 16px;

    color: var(--text);

    background: #090f1b;

    border: 1px solid var(--border);

    border-radius: 12px;

    outline: none;
}

.auth-box input:focus {
    border-color: var(--primary);
}


/* =====================================================
   BUTONLAR
===================================================== */

.primary-btn,
.secondary-btn,
.danger-btn {
    width: 100%;

    padding: 13px 16px;

    border-radius: 12px;

    transition:
        transform 0.15s,
        opacity 0.15s,
        background 0.15s;
}

.primary-btn {
    color: white;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #7c3aed
        );
}

.secondary-btn {
    color: var(--text);

    background: var(--panel-2);

    border: 1px solid var(--border);
}

.danger-btn {
    color: white;

    background: var(--danger);
}

.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active,
.danger-btn:active {
    transform: scale(0.98);
}


/* =====================================================
   AI ANA LAYOUT
===================================================== */

#aiScreen {
    display: flex;
    width: 100%;
    height: 100dvh;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    width: 290px;
    min-width: 290px;

    height: 100%;

    display: flex;
    flex-direction: column;

    background:
        rgba(10, 16, 28, 0.96);

    border-right:
        1px solid var(--border);

    z-index: 20;
}

.sidebar-header {
    height: 65px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 16px;

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

.sidebar-header strong {
    font-size: 20px;
}

.icon-btn {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text);

    background: transparent;

    border-radius: 10px;

    font-size: 19px;
}

.icon-btn:hover {
    background: var(--panel-2);
}

.new-chat-btn {
    margin: 15px;

    padding: 13px;

    color: white;

    background: var(--primary);

    border-radius: 12px;
}

.sidebar-title {
    padding:
        5px 17px 10px;

    color: var(--muted);

    font-size: 13px;
}

.chat-list {
    flex: 1;

    overflow-y: auto;

    padding: 0 10px 10px;
}


/* =====================================================
   CHAT ITEM
===================================================== */

.chat-item {
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 5px;

    margin-bottom: 5px;

    padding:
        5px 6px 5px 12px;

    border-radius: 10px;

    color: var(--muted);

    transition:
        background 0.15s;
}

.chat-item:hover,
.chat-item.active {
    background: var(--panel-2);
    color: var(--text);
}

.chat-title {
    flex: 1;

    min-width: 0;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    cursor: pointer;
}

.chat-actions {
    display: flex;

    gap: 2px;

    opacity: 0;

    transition: opacity 0.15s;
}

.chat-item:hover .chat-actions,
.chat-item.active .chat-actions {
    opacity: 1;
}

.chat-action-btn {
    width: 32px;
    height: 32px;

    border-radius: 8px;

    color: var(--muted);

    background: transparent;
}

.chat-action-btn:hover {
    color: white;
    background: #26334a;
}

.chat-action-btn.delete:hover {
    color: #fff;
    background: var(--danger);
}


/* =====================================================
   SIDEBAR ALT
===================================================== */

.sidebar-bottom {
    padding: 12px;

    border-top:
        1px solid var(--border);
}

.username-display {
    padding: 10px;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 14px;
}

.sidebar-btn {
    width: 100%;

    padding: 10px;

    margin-top: 5px;

    text-align: left;

    color: var(--text);

    background: transparent;

    border-radius: 10px;
}

.sidebar-btn:hover {
    background: var(--panel-2);
}


/* =====================================================
   ANA AI
===================================================== */

.ai-main {
    flex: 1;

    min-width: 0;

    height: 100%;

    display: flex;
    flex-direction: column;
}


/* =====================================================
   TOPBAR
===================================================== */

.topbar {
    height: 65px;

    min-height: 65px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 15px;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(7, 11, 20, 0.78);

    backdrop-filter: blur(15px);
}

.topbar-title {
    display: flex;
    align-items: center;

    gap: 9px;

    font-weight: 700;
}

.ai-icon {
    font-size: 22px;
}


/* =====================================================
   MESAJLAR
===================================================== */

.messages {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding:
        25px max(18px, calc((100% - 900px) / 2));
}

.welcome {
    min-height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 30px;
}

.welcome-icon {
    width: 75px;
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 23px;

    font-size: 38px;

    background:
        linear-gradient(
            135deg,
            #6366f1,
            #7c3aed
        );
}

.welcome h1 {
    font-size: 30px;

    margin-bottom: 8px;
}

.welcome p {
    color: var(--muted);

    margin-bottom: 25px;
}

.suggestions {
    width: min(600px, 100%);

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 10px;
}

.suggestion-btn {
    padding: 13px;

    color: var(--text);

    text-align: left;

    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.suggestion-btn:hover {
    background: var(--panel-2);
}


/* =====================================================
   MESAJ
===================================================== */

.message {
    display: flex;

    width: 100%;

    margin-bottom: 15px;
}

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.bubble {
    max-width: min(80%, 720px);

    padding:
        12px 15px;

    line-height: 1.55;

    white-space: pre-wrap;

    overflow-wrap: anywhere;

    border-radius: 17px;
}

.message.user .bubble {
    background: var(--user);

    border-bottom-right-radius: 5px;
}

.message.ai .bubble {
    background: var(--ai);

    border:
        1px solid var(--border);

    border-bottom-left-radius: 5px;
}


/* =====================================================
   MESAJ DOSYALARI
===================================================== */

.message-image {
    display: block;

    max-width: min(500px, 100%);

    max-height: 450px;

    margin-bottom: 8px;

    border-radius: 12px;
}

.message-video {
    display: block;

    width: min(500px, 100%);

    max-height: 450px;

    margin-bottom: 8px;

    border-radius: 12px;
}

.message-file {
    padding: 10px 12px;

    margin-bottom: 7px;

    background:
        rgba(255, 255, 255, 0.06);

    border-radius: 9px;
}


/* =====================================================
   ATTACHMENT PREVIEW
===================================================== */

.attachment-preview {
    position: relative;

    width: min(900px, calc(100% - 30px));

    margin:
        0 auto 8px;

    padding: 10px;

    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 13px;
}

#attachmentContent img,
#attachmentContent video {
    display: block;

    max-width: 250px;

    max-height: 150px;

    border-radius: 9px;
}

.file-preview {
    padding: 8px;
}

.remove-attachment {
    position: absolute;

    top: 7px;
    right: 7px;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    color: white;

    background: var(--danger);
}


/* =====================================================
   COMPOSER
===================================================== */

.composer {
    width: min(900px, calc(100% - 30px));

    min-height: 58px;

    display: flex;
    align-items: flex-end;

    gap: 6px;

    margin:
        0 auto;

    padding: 8px;

    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 18px;

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.25);
}

.composer textarea {
    flex: 1;

    min-width: 0;

    max-height: 180px;

    resize: none;

    overflow-y: auto;

    padding:
        9px 8px;

    color: var(--text);

    background: transparent;

    border: 0;

    outline: none;

    line-height: 1.5;
}

.composer textarea::placeholder {
    color: #718096;
}

.composer-btn,
.send-btn {
    flex-shrink: 0;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    font-size: 18px;
}

.composer-btn {
    color: var(--muted);

    background: transparent;
}

.composer-btn:hover {
    color: white;
    background: var(--panel-2);
}

.composer-btn.recording {
    color: white;

    background: var(--danger);

    animation:
        pulse 1s infinite;
}

.send-btn {
    color: white;

    background: var(--primary);
}

.send-btn:hover {
    background: var(--primary-hover);
}

@keyframes pulse {

    50% {
        transform: scale(1.08);
    }
}

.composer-info {
    width: 100%;

    padding:
        7px 15px 10px;

    color: #667085;

    text-align: center;

    font-size: 11px;
}


/* =====================================================
   KAMERA MODAL
===================================================== */

.modal {
    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.75);

    backdrop-filter: blur(8px);
}

.camera-box {
    width: min(650px, 100%);

    padding: 15px;

    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 20px;

    box-shadow:
        0 30px 80px
        rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}

.camera-box video {
    width: 100%;

    max-height: 65vh;

    display: block;

    object-fit: cover;

    background: black;

    border-radius: 13px;
}

.camera-controls {
    display: flex;

    gap: 10px;

    margin-top: 12px;
}

.camera-controls button {
    flex: 1;
}


/* =====================================================
   ADMIN
===================================================== */

#adminScreen {
    overflow-y: auto;

    padding: 25px;
}

.admin-container {
    width: min(900px, 100%);

    margin: 0 auto;
}

.admin-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.admin-header h1 {
    margin-bottom: 5px;
}

.admin-header p {
    color: var(--muted);
}

.admin-header .secondary-btn {
    width: auto;
}

.admin-card {
    padding: 20px;

    margin-bottom: 20px;

    background: var(--panel);

    border:
        1px solid var(--border);

    border-radius: 17px;
}

.admin-card h2 {
    margin-bottom: 5px;
}

.user-count {
    color: var(--muted);

    margin-bottom: 15px;
}

.users-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.user-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 12px;

    background: var(--panel-2);

    border-radius: 11px;
}

.delete-user {
    padding: 8px 11px;

    color: white;

    background: var(--danger);

    border-radius: 8px;
}


/* =====================================================
   TOAST
===================================================== */

.toast {
    position: fixed;

    left: 50%;
    bottom: 25px;

    z-index: 200;

    max-width: calc(100% - 30px);

    padding:
        12px 17px;

    color: white;

    background: #151f31;

    border:
        1px solid var(--border);

    border-radius: 12px;

    box-shadow:
        0 15px 40px
        rgba(0, 0, 0, 0.4);

    transform:
        translate(-50%, 100px);

    opacity: 0;

    pointer-events: none;

    transition:
        transform 0.25s,
        opacity 0.25s;
}

.toast.show {
    transform:
        translate(-50%, 0);

    opacity: 1;
}


/* =====================================================
   SCROLLBAR
===================================================== */

* {
    scrollbar-width: thin;

    scrollbar-color:
        #334155
        transparent;
}

::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;

    border-radius: 20px;
}


/* =====================================================
   MOBİL
===================================================== */

@media (max-width: 700px) {

    .sidebar {
        position: fixed;

        left: 0;
        top: 0;
        bottom: 0;

        width: min(300px, 85vw);

        transform:
            translateX(-105%);

        transition:
            transform 0.25s ease;

        box-shadow:
            15px 0 50px
            rgba(0, 0, 0, 0.4);
    }

    .sidebar.open {
        transform:
            translateX(0);
    }

    .topbar {
        height: 58px;
        min-height: 58px;
    }

    .messages {
        padding:
            15px 10px;
    }

    .bubble {
        max-width: 88%;

        padding:
            10px 12px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .welcome {
        padding: 15px;
    }

    .welcome h1 {
        font-size: 25px;
    }

    .composer {
        width:
            calc(100% - 12px);

        border-radius: 15px;

        gap: 2px;
    }

    .composer-btn,
    .send-btn {
        width: 36px;
        height: 36px;

        font-size: 16px;
    }

    .composer textarea {
        font-size: 15px;
    }

    .composer-info {
        padding-bottom: 6px;
    }

    .camera-controls {
        flex-direction: column;
    }

    .admin-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .admin-header .secondary-btn {
        width: 100%;
    }

    .user-row {
        align-items: flex-start;

        flex-direction: column;
    }

    .delete-user {
        width: 100%;
    }

    .chat-actions {
        opacity: 1;
    }
}


/* =====================================================
   KÜÇÜK TELEFON
===================================================== */

@media (max-width: 420px) {

    .auth-container {
        padding:
            25px 17px;
    }

    .logo {
        width: 65px;
        height: 65px;

        font-size: 34px;
    }

    .auth-container h1 {
        font-size: 27px;
    }

    .composer-btn:nth-of-type(2) {
        display: none;
    }

    .composer-info {
        font-size: 10px;
    }
}