/* Chat Widget Styles */
:root {
    --chat-bg: #1a1a1a;
    --chat-header: #262626;
    --chat-border: rgba(0, 255, 255, 0.1);
    --chat-text: #ffffff;
    --chat-input-bg: #262626;
    --chat-bot-msg: #262626;
    --chat-user-msg: #00ffff;
    --chat-button-bg: #00ffff;
    --chat-button-hover: #00d6d6;
}

.chat-container {
    position: fixed;
    right: 30px;
    bottom: 90px;
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--chat-border);
}

.chat-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-container.fullscreen {
    width: 100%;
    height: 100vh;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

.chat-container.minimized {
    height: 60px;
    overflow: hidden;
}

.chat-header {
    padding: 18px 20px;
    background: linear-gradient(45deg, #00ffff, #00ccff);
    color: #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.chat-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1));
    pointer-events: none;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-title i {
    font-size: 20px;
    color: #000000;
}

.chat-controls {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: flex-start; /* Soldan sağa sıralama */
    flex-wrap: nowrap; /* Butonların alt satıra geçmesini engelle */
}

.control-button {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s ease;
    font-size: 18px;
    order: initial; /* CSS order özelliğini sıfırla */
    border-radius: 50%;
}

.control-button:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.8), rgba(30, 30, 30, 0.95));
}

.message {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-msg);
    color: var(--chat-text);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--chat-border);
    animation: fadeIn 0.3s ease-in-out;
}

.message.bot p {
    margin: 10px 0;
    line-height: 1.6;
}

.message.bot ul {
    padding-left: 20px;
    margin: 12px 0;
    list-style-type: disc;
}

.message.bot li {
    margin-bottom: 6px;
    position: relative;
}

.message.bot em {
    font-style: italic;
    color: #00ffff;
    font-weight: 500;
}

.message.bot code {
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #00ffff;
    font-size: 13px;
}

.message.bot a {
    color: #00ffff;
    text-decoration: underline;
    transition: color 0.2s;
}

.message.bot a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.message.bot .highlight {
    background-color: rgba(0, 255, 255, 0.1);
    padding: 2px 0;
    border-radius: 2px;
}

.message.bot .formula {
    display: block;
    margin: 10px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #00ffff;
}

.message.bot h3 {
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #00ffff;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 5px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-msg);
    color: var(--chat-bg);
    border-bottom-right-radius: 5px;
    animation: slideIn 0.3s ease-in-out;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-input-container {
    padding: 15px;
    background: var(--chat-header);
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 10px;
    position: relative;
}

#chatInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 45px;
    max-height: 120px;
    background: var(--chat-input-bg);
    color: var(--chat-text);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#chatInput:focus {
    border-color: var(--chat-button-bg);
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#chatInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#sendMessage {
    background: var(--chat-button-bg);
    color: var(--chat-bg);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

#sendMessage:hover {
    background: var(--chat-button-hover);
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.4);
}

#sendMessage:active {
    transform: scale(0.95);
}

/* Süper Dikkat Çekici Chatbot Animasyonları */
@keyframes mega-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.9), 0 0 0 0 rgba(0, 255, 255, 0.5);
        transform: scale(1) rotate(0deg);
    }
    25% {
        box-shadow: 0 0 0 20px rgba(0, 255, 255, 0), 0 0 0 10px rgba(0, 255, 255, 0.2);
        transform: scale(1.1) rotate(5deg);
    }
    50% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.9), 0 0 0 0 rgba(0, 255, 255, 0.5);
        transform: scale(1) rotate(0deg);
    }
    75% {
        box-shadow: 0 0 0 20px rgba(0, 255, 255, 0), 0 0 0 10px rgba(0, 255, 255, 0.2);
        transform: scale(1.1) rotate(-5deg);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.9), 0 0 0 0 rgba(0, 255, 255, 0.5);
        transform: scale(1) rotate(0deg);
    }
}

@keyframes bounce-attention {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-20px) scale(1.1);
    }
    60% {
        transform: translateY(-10px) scale(1.05);
    }
}

@keyframes color-shift {
    0% {
        background: #00ffff;
    }
    25% {
        background: #00ccff;
    }
    50% {
        background: #00ffaa;
    }
    75% {
        background: #00ddff;
    }
    100% {
        background: #00ffff;
    }
}

@keyframes shine {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.chat-button {
    position: fixed;
    right: 30px;
    bottom: 30px;
    background: var(--chat-button-bg);
    color: var(--chat-bg);
    border: none;
    border-radius: 50%;
    width: 75px;
    height: 75px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
    border: 3px solid rgba(0, 255, 255, 0.8);
    overflow: hidden;
    animation: 
        mega-pulse 3s infinite,
        bounce-attention 6s infinite,
        color-shift 8s infinite;
    background-image: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation-name: mega-pulse, bounce-attention, color-shift, shine;
    animation-duration: 3s, 6s, 8s, 3s;
    animation-timing-function: ease-in-out, ease, linear, linear;
    animation-iteration-count: infinite;
    animation-delay: 0s, 0s, 0s, 0s;
}

.chat-button::before {
    content: 'Bana Sor!';
    position: absolute;
    top: -40px;
    font-size: 14px;
    background: var(--chat-button-bg);
    color: #000;
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    animation: bounce-attention 4s 2s infinite;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    white-space: nowrap;
    font-weight: bold;
}

.chat-button:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.chat-button i {
    font-size: 36px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chat-button:hover {
    transform: scale(1.2) rotate(10deg);
    box-shadow: 0 6px 30px rgba(0, 255, 255, 0.8);
}

.chat-button:hover i {
    transform: rotate(20deg) scale(1.2);
    animation: none;
}

@media (max-width: 768px) {
    .chat-button {
        width: 65px;
        height: 65px;
        right: 20px;
        bottom: 20px;
    }
    
    .chat-button i {
        font-size: 32px;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    justify-content: center;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chat-button-bg);
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--chat-bg);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chat-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chat-button-bg);
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .chat-button {
        right: 20px;
        bottom: 20px;
    }
}

/* Feedback Modal Styles */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback-modal.active {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.feedback-content {
    background: #1a1a1a;
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.feedback-modal.active .feedback-content {
    transform: translateY(0);
}

.feedback-header {
    padding: 15px;
    background: #262626;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.feedback-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-size: 20px;
}

.close-modal:hover {
    opacity: 1;
    color: var(--chat-button-bg);
}

.feedback-body {
    padding: 20px;
    color: #ffffff;
}

.feedback-body p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.feedback-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.feedback-button {
    background: var(--chat-button-bg);
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feedback-button:hover {
    background: var(--chat-button-hover);
    transform: translateY(-2px);
}

.feedback-button.secondary {
    background: transparent;
    border: 1px solid var(--chat-button-bg);
    color: var(--chat-button-bg);
}

.feedback-button.secondary:hover {
    background: rgba(0, 255, 255, 0.1);
}

.feedback-button i {
    font-size: 18px;
}
