* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-widget.minimized {
    height: 60px;
    width: 380px;
}

.chat-widget.minimized .chat-body,
.chat-widget.minimized .chat-input-container,
.chat-widget.minimized .pre-chat-form {
    display: none !important;
}

/* Chat Header */
.chat-header {
    background: #2a2a2a;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-container {
    position: relative;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: bold;
    font-size: 16px;
    color: #ffffff;
}

.subtitle {
    font-size: 12px;
    color: #aaaaaa;
}

.minimize-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.minimize-btn:hover {
    background: #333;
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #1a1a1a;
    position: relative;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
}

.message.bot {
    background: #2a2a2a;
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: #ffc107;
    color: #1a1a1a;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.message-time {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

/* Message Links */
.message a {
    color: #ffc107;
    text-decoration: underline;
    word-break: break-all;
}

.message.user a {
    color: #1a1a1a;
    text-decoration: underline;
}

.message a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Pre-Chat Form */
.pre-chat-form {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
}

.pre-chat-form.hidden {
    display: none !important;
}

.form-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-text {
    font-size: 13px;
    line-height: 1.6;
    color: #ffffff;
}

.info-text p {
    margin-bottom: 8px;
}

.info-text a {
    color: #ffc107;
    text-decoration: underline;
}

.info-text strong {
    color: #ffc107;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
}

.form-group input {
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #ffc107;
}

.form-group input:first-of-type {
    border-color: #ffc107;
}

.start-chat-btn {
    padding: 14px;
    background: #ffc107;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.start-chat-btn:hover {
    background: #ffb300;
}

.start-chat-btn:active {
    transform: scale(0.98);
}

/* Chat Input */
.chat-input-container {
    padding: 12px;
    background: #2a2a2a;
    border-top: 1px solid #333;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #ffc107;
}

.chat-input::placeholder {
    color: #888;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: #ffc107;
    border: none;
    border-radius: 50%;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #ffb300;
}

.send-btn:active {
    transform: scale(0.95);
}

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #ffc107;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle .toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-widget:not(.hidden) ~ .chat-toggle {
    display: none;
}

.chat-widget.hidden ~ .chat-toggle {
    display: flex;
}

/* Chat Link Container */
.chat-link-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    display: block;
}

.chat-link-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #ffc107;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.2s;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.chat-link-btn:hover {
    background: #ffb300;
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-link-container {
        display: none;
    }

    .chat-toggle {
        display: flex;
    }

    .chat-widget:not(.hidden) {
        display: flex;
    }
    
    /* Chat Input Container - Mobil için sabit */
    .chat-input-container {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
        background: #2a2a2a;
        border-top: 1px solid #333;
        z-index: 10;
        flex-shrink: 0;
    }
    
    .chat-input-wrapper {
        display: flex;
        gap: 8px;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }
    
    .chat-input {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        min-width: 40px;
    }
    
    /* Klavye açıldığında viewport değişikliği için */
    @media (max-height: 500px) {
        .chat-input-container {
            padding: 8px;
        }
        
        .chat-input {
            padding: 8px 12px;
            font-size: 14px;
        }
        
        .send-btn {
            width: 36px;
            height: 36px;
            min-width: 36px;
        }
    }
}

@media (min-width: 769px) {
    .chat-link-container {
        display: block;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 12px;
    width: fit-content;
    align-self: flex-start;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* LiveChat Iframe Container */
.livechat-iframe-container {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.livechat-header {
    padding: 12px 16px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.livechat-header span {
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
}

.close-iframe-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}

.close-iframe-btn:hover {
    background: #333;
}

.livechat-iframe-container iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive for LiveChat Iframe */
@media (max-width: 768px) {
    .livechat-iframe-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        z-index: 100000;
    }
    
    .chat-widget {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

