:root { 
    --primary: #E30A17; 
    --bg-chat: #f4f6f8; 
    --user-bg: #E30A17; 
    --bot-bg: #ffffff; 
}

body { 
    font-family: 'Inter', sans-serif; 
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0; 
    overflow: hidden; 
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    width: 380px; 
    height: 600px;
    max-height: 80vh;
    background: #fff; 
    border-radius: 16px; 
    box-shadow: 0 5px 40px rgba(0,0,0,0.2); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    z-index: 9999; 
    transition: all 0.3s ease; 
}

@media (max-width: 480px) { 
    .chat-widget { 
        width: 100% !important; 
        height: 100% !important; 
        max-height: 100% !important;
        bottom: 0 !important; 
        right: 0 !important; 
        border-radius: 0 !important; 
    } 
}

.chat-widget.minimized { 
    height: 60px; 
    width: 60px; 
    border-radius: 50%; 
    cursor: pointer; 
    background: var(--primary); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 0; 
}

.chat-widget.minimized > *:not(.minimized-icon) { 
    display: none !important; 
}

.chat-widget.minimized::after { 
    content: 'chat_bubble'; 
    font-family: 'Material Icons'; 
    color: white; 
    font-size: 30px; 
}

.header { 
    background: var(--primary); 
    padding: 15px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    color: white; 
    cursor: pointer; 
}

.header-info { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.header-logo { 
    width: 36px; 
    height: 36px; 
    background: white; 
    border-radius: 50%; 
    padding: 2px; 
    object-fit: contain; 
}

.header-text h3 { 
    margin: 0; 
    font-size: 16px; 
    font-weight: 600; 
}

.header-text p { 
    margin: 0; 
    font-size: 12px; 
    opacity: 0.9; 
}

.body { 
    flex: 1; 
    padding: 15px; 
    overflow-y: auto; 
    background: var(--bg-chat); 
    background-image: url('https://www.etimesgut.bel.tr/storage/app/media/logo/logo-et.png'); 
    background-repeat: no-repeat; 
    background-position: center; 
    background-size: 60%; 
    background-blend-mode: soft-light; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    position: relative; 
}

.msg { 
    max-width: 85%; 
    padding: 12px 16px; 
    border-radius: 12px; 
    font-size: 14px; 
    line-height: 1.5; 
    word-wrap: break-word; 
    animation: fadeIn 0.2s ease; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}

.bot { 
    background: var(--bot-bg); 
    color: #333; 
    align-self: flex-start; 
    border-bottom-left-radius: 2px; 
    border: 1px solid #eef0f2; 
}

.user { 
    background: var(--user-bg); 
    color: white; 
    align-self: flex-end; 
    border-bottom-right-radius: 2px; 
}

.ticket-card { 
    background: #ffffff; 
    border-left: 5px solid #2e7d32; 
    border-radius: 8px; 
    margin-top: 5px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
    overflow: hidden; 
    font-size: 13px; 
}

.ticket-header { 
    background: #f1f8e9; 
    color: #2e7d32; 
    padding: 10px 15px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    border-bottom: 1px solid #c8e6c9; 
}

.ticket-body { 
    padding: 15px; 
}

.ticket-row { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
    color: #555; 
}

.input-area { 
    background: white; 
    padding: 12px; 
    border-top: 1px solid #eee; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    position: relative; 
}

.input-wrapper { 
    flex: 1; 
    position: relative; 
    display: flex; 
    align-items: center; 
}

#userInput { 
    width: 100%; 
    padding: 12px 15px; 
    padding-right: 40px; 
    border: 1px solid #ddd; 
    border-radius: 24px; 
    outline: none; 
    font-size: 14px; 
    background: #f9f9f9; 
}

.mic-btn-inside { 
    position: absolute; 
    right: 5px; 
    background: none; 
    border: none; 
    color: #888; 
    cursor: pointer; 
    padding: 5px; 
}

.mic-btn-inside.recording { 
    color: red; 
    animation: pulse 1s infinite; 
}

.tools-menu { 
    position: absolute; 
    bottom: 75px; 
    left: 10px; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.15); 
    padding: 8px; 
    display: none; 
    flex-direction: column; 
    gap: 5px; 
    z-index: 100; 
    width: 160px; 
    border: 1px solid #eee; 
}

.tools-menu.active { 
    display: flex; 
    animation: slideUp 0.2s; 
}

.tool-btn { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 10px; 
    cursor: pointer; 
    border-radius: 8px; 
    font-size: 13px; 
    color: #444; 
    transition: 0.2s; 
}

.tool-btn:hover { 
    background: #f5f5f5; 
    color: var(--primary); 
}

.circle-btn { 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    border: none; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    transition: 0.2s; 
    flex-shrink: 0; 
}

.btn-plus { 
    background: #f0f2f5; 
    color: #555; 
}

.btn-send { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 3px 10px rgba(227,10,23,0.3); 
}

.preview-area { 
    padding: 10px 15px; 
    background: #f8f9fa; 
    border-top: 1px solid #eee; 
    font-size: 12px; 
    display: none; 
    align-items: center; 
    justify-content: space-between; 
}

.preview-content img { 
    height: 45px; 
    border-radius: 6px; 
    border: 1px solid #ddd; 
}

.typing { 
    font-size: 11px; 
    color: #999; 
    margin-left: 15px; 
    margin-bottom: 5px; 
    display: none; 
    font-style: italic; 
}

.footer-sign { 
    text-align: center; 
    font-size: 9px; 
    color: #999; 
    padding: 8px 0; 
    background: white; 
    user-select: none; 
}

.footer-sign a { 
    color: #666; 
    text-decoration: none; 
    transition: color 0.2s;
}

.footer-sign a:hover { 
    color: var(--primary); 
}

.end-screen { 
    display: none; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
    text-align: center; 
    animation: fadeIn 0.5s; 
}

.end-logo { 
    width: 100px; 
    margin-bottom: 20px; 
    filter: drop-shadow(0 5px 15px rgba(227, 10, 23, 0.2)); 
}

.end-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: #333; 
    margin-bottom: 5px; 
}

.end-message { 
    font-size: 14px; 
    color: #666; 
    margin-bottom: 25px; 
    max-width: 80%; 
    line-height: 1.5; 
}

.restart-btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 12px 25px; 
    border-radius: 25px; 
    font-weight: 600; 
    cursor: pointer; 
    box-shadow: 0 5px 15px rgba(227, 10, 23, 0.4); 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: transform 0.2s; 
    font-size: 14px; 
}

.restart-btn:hover { 
    transform: scale(1.05); 
}

@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: translateY(5px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

@keyframes slideUp { 
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

@keyframes pulse { 
    0% { 
        transform: scale(1); 
    } 
    50% { 
        transform: scale(1.2); 
    } 
    100% { 
        transform: scale(1); 
    } 
}

/* PWA İyileştirmeleri */
@media (display-mode: standalone) {
    body {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* iOS Safari için özel ayarlar */
@supports (-webkit-touch-callout: none) {
    .chat-widget {
        padding-bottom: env(safe-area-inset-bottom);
    }
}