/* --- TEMEL AYARLAR --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a28;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --glow-blue: rgba(59, 130, 246, 0.3);
    --glow-purple: rgba(139, 92, 246, 0.3);
}

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

/* --- SAYFA AÇILIŞ ANIMASYONU --- */
@keyframes pageLoad {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000000;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    animation: pageLoad 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- ORTADA MAVİ IŞIK EFEKTİ --- */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* --- GRİD PATTERN (Kenarları Silinmiş Beyaz Çizgiler) --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}

/* --- ÜST BAR --- */
.top-bar {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 100;
}

.browser-button {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.browser-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(59, 130, 246, 0.2);
}

/* --- ANA KONTEYNER --- */
.main-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    position: relative;
    z-index: 1;
}

/* --- BAŞLIK ANIMASYONU (Shimmer Effect) --- */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.title {
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 5px;
    position: relative;
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #ffffff 40%,
        #e0e0e0 50%,
        #ffffff 60%,
        #ffffff 100%
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    text-align: center;
}

/* --- SOHBET ALANI --- */
.chat-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* --- UYARI METNİ --- */
.disclaimer {
    text-align: center;
    color: rgba(161, 161, 170, 0.7);
    font-size: 13px;
    font-weight: 400;
    margin-top: 8px;
}

/* --- MODERN SOHBET KUTUSU --- */
.chat-box {
    width: 100%;
    height: 0;
    opacity: 0;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chat-box.active {
    height: 450px;
    opacity: 1;
    padding: 24px;
}

.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- MESAJ BALONLARI --- */
@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message {
    max-width: 80%;
    padding: 14px 20px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
    animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    word-wrap: break-word;
}

.user-message {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ai-message {
    background: rgba(30, 30, 45, 0.6);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.ai-message-content {
    flex: 1;
    padding-top: 2px;
}

/* --- INPUT FORMU --- */
.chat-form {
    position: relative;
    display: flex;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50px;
}

@keyframes inputGlow {
    0%, 100% {
        box-shadow: 
            0 0 0 0 rgba(59, 130, 246, 0),
            0 4px 16px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 
            0 0 30px 5px rgba(59, 130, 246, 0.4),
            0 8px 24px rgba(59, 130, 246, 0.3);
    }
}

.chat-form.glowing {
    animation: inputGlow 1.2s ease-out;
}

#user-input {
    flex-grow: 1;
    background: rgba(25, 30, 45, 0.85);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
    padding: 16px 70px 16px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 400;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#user-input::placeholder {
    color: rgba(161, 161, 170, 0.6);
}

#user-input:focus {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(25, 30, 45, 0.95);
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.15),
        0 4px 24px rgba(59, 130, 246, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

#send-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#send-button:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-50%) scale(1.08);
}

#send-button:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

#send-button svg {
    width: 22px;
    height: 22px;
    fill: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

#send-button:hover svg {
    fill: rgba(255, 255, 255, 1);
    transform: translateX(2px);
}

/* --- GİRİŞ MODALI --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

@keyframes modalSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    background: rgba(15, 20, 35, 0.98);
    backdrop-filter: blur(40px);
    padding: 30px 35px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 25px;
}

.modal-icon {
    font-size: 42px;
    margin-bottom: 15px;
    filter: drop-shadow(0 6px 16px rgba(59, 130, 246, 0.4));
}

.modal-content h2 {
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.modal-content p {
    color: rgba(161, 161, 170, 0.85);
    font-size: 14px;
    line-height: 1.5;
}

/* Auth Form Styles */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px;
    border-radius: 10px;
}

.auth-tab {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.auth-tab.active {
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: rgba(161, 161, 170, 0.5);
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.2);
}

.auth-button:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(59, 130, 246, 0.4),
        0 3px 10px rgba(0, 0, 0, 0.3);
}

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

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: rgba(161, 161, 170, 0.6);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-button {
    width: 100%;
    padding: 11px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-button svg {
    width: 18px;
    height: 18px;
}

.guest-button {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.guest-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* --- MOBİL UYUM --- */
@media (max-width: 768px) {
    .title {
        font-size: 3.5rem;
        letter-spacing: -1px;
    }

    body {
        padding: 15px;
    }

    .chat-box.active {
        height: 400px;
    }

    .top-bar {
        top: 15px;
        right: 15px;
    }

    .browser-button {
        padding: 10px 18px;
        font-size: 13px;
    }

    .modal-content {
        padding: 35px 30px;
        margin: 0 20px;
    }

    #user-input {
        padding: 16px 60px 16px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2.5rem;
    }

    .chat-box.active {
        height: 350px;
        padding: 20px;
    }

    .message {
        font-size: 14px;
        padding: 12px 16px;
    }
}
