:root {
    /* Primary Brand Colors */
    --primary-blue: #124f90;
    --secondary-blue: #232F58;
    --accent-red: #ce122d;
    
    /* Rigicon Logo Colors */
    --rigicon-logo-blue: #195090;
    --rigicon-logo-red: #ce0e2d;
    
    /* Extended Brand Palette */
    --premier-blue: #1B358A;
    --dark-blue: #112657;
    --light-blue: #D1D9F0;
    
    /* Background Colors */
    --background-soft: #e8eef5;
    --background-white: #ffffff;
    --light-gray: #F5F5F5;
    
    /* Text Colors */
    --text-color: #232F58;
    --text-muted: #5a6c84;
    --text-light: #8a8a8a;
    
    /* Functional Colors */
    --shadow-light: rgba(0, 0, 0, 0.04);
    --shadow-medium: rgba(0, 0, 0, 0.06);
    --shadow-strong: rgba(0, 0, 0, 0.08);
    
    /* Interactive States */
    --hover-blue: #0f4080;
    --focus-outline: #ffbf47;
    --border-color: #e8ecf1;
    --border-hover: var(--primary-blue);
}

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

sup {
    top: -.4em !important;
    font-size: 60% !important;
}

/* Body styles removed - will be handled by main page CSS */

.test-header {
    max-width: 900px;
    margin: 0 auto 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.test-header h1 {
    color: #232f58;
    margin-bottom: 10px;
}

.test-header p {
    color: #909090;
}

.config-panel {
    max-width: 900px;
    margin: 0 auto 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.config-item {
    margin-bottom: 15px;
}

.config-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #212121;
}

.config-item input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.controls button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #232f58 0%, #1a2341 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.2s;
}

.controls button:hover {
    transform: translateY(-2px);
}

.controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Chat Interface - Light Theme */
.chat-container {
    width: 100%;        /* Container genişliğine uyar */
    margin: 0;
    height: 700px;
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--background-white) 100%) !important;
    backdrop-filter: blur(40px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(144, 144, 144, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Animated blobs */
.chat-container::before,
.chat-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: blob-float 7s infinite;
    pointer-events: none;
}

.chat-container::before {
    top: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    background: rgba(206, 14, 45, 0.08);
}

.chat-container::after {
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(35, 47, 88, 0.08);
    animation-delay: 2s;
}

@keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Header */
.chat-header {
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 20px;
    border-bottom: 1px solid rgba(144, 144, 144, 0.15);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.chat-header-content {
    flex: 1;
}

.chat-header h2 {
    margin: 0;
    font-size: 18px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: white;
}

.chat-header p {
    margin: 5px 0 0;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.9);
}

/* Messages */
.chat-messages {
    position: relative;
    z-index: 10;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 30px; /* Just enough padding so messages don't stick to bottom */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(144, 144, 144, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(144, 144, 144, 0.5);
}

.message {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 80%;
    animation: slide-in 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    border-top-right-radius: 4px;
    margin-left: auto;
    font-family: 'Montserrat', sans-serif;
}

.message.agent {
    align-self: flex-start;
    background: rgba(248, 248, 248, 0.8);
    backdrop-filter: blur(20px);
    color: var(--secondary-blue);
    border-top-left-radius: 4px;
    border: 1px solid rgba(144, 144, 144, 0.15);
    font-family: 'Montserrat', sans-serif;
}

.message.system {
    align-self: center;
    background: rgba(227, 220, 178, 0.25);
    color: #212121;
    border: 1px solid rgba(227, 220, 178, 0.4);
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    max-width: 90%;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.message.agent .message-time,
.message.system .message-time {
    color: #909090;
}

/* Action Buttons Area */
#actionButtonsArea {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 20px 20px;
    min-height: 0; /* Allow shrinking when empty */
}

.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slide-in 0.4s ease-out;
}

.action-button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(18, 79, 144, 0.2);
}

.action-button i {
    font-size: 18px;
    color: white;
}

.action-button .fa-comments {
    color: #22d3ee;
}

.action-button .fa-hospital {
    color: white;
}

.action-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 79, 144, 0.3);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-button.clicked {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(18, 79, 144, 0.3);
}

/* Input Area */
.chat-input-area {
    position: relative;
    z-index: 10;
    padding: 20px;
    background: rgba(248, 248, 248, 0.6);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(144, 144, 144, 0.15);
    display: none;
    gap: 10px;
}

.chat-input-area.active {
    display: flex;
}

.chat-input-area input {
    flex: 1;
    background: white;
    border: 2px solid rgba(144, 144, 144, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    color: #212121;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.chat-input-area input::placeholder {
    color: #909090;
}

.chat-input-area input:focus {
    outline: none;
    border: 2px solid transparent;
    background-image: 
        linear-gradient(white, white),
        linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 0 3px rgba(18, 79, 144, 0.1);
}

.chat-input-area button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 15px rgba(18, 79, 144, 0.2);
}

.chat-input-area button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary-blue) 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(18, 79, 144, 0.3);
}

.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.status-badge.connected {
    background: rgba(79, 218, 115, 0.2);
    color: #4fda73;
    border: 1px solid rgba(79, 218, 115, 0.3);
}

.status-badge.disconnected {
    background: rgba(207, 14, 46, 0.2);
    color: #cf0e2e;
    border: 1px solid rgba(207, 14, 46, 0.3);
}

/* Consent Container Styles */
.consent-container {
    position: relative;
    z-index: 10;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

/* Smooth scrollbar for consent container */
.consent-container::-webkit-scrollbar {
    width: 6px;
}

.consent-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.consent-container::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
}

.consent-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-blue);
}

.consent-checkbox-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(248, 248, 248, 0.6);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.consent-checkbox-group:hover {
    background: rgba(248, 248, 248, 0.9);
}

.consent-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: var(--primary-blue);
    margin-top: 2px;
    transition: transform 0.2s ease;
}

.consent-checkbox:hover {
    transform: scale(1.1);
}

.consent-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.consent-text:hover {
    color: var(--primary-blue);
}

.consent-submit-button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(18, 79, 144, 0.2);
    opacity: 1;
}

.consent-submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.consent-submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 79, 144, 0.3);
}

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

.consent-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px solid rgba(144, 144, 144, 0.2);
    flex-wrap: wrap;
}

.consent-footer-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.consent-footer-links a:hover {
    color: var(--accent-red);
    text-decoration: underline;
}

.consent-footer-links span {
    color: #909090;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    /* Consent Container - Mobilde daha dar padding */
    .consent-container {
        margin: 8px;
        padding: 18px 12px;
        max-height: 90vh; /* 80vh'den 90vh'ye yükseltildi - footer linkler görünsün */
        gap: 15px;
    }
    
    /* Chat Messages - Mobilde padding azaltıldı */
    .chat-messages {
        padding: 12px 4px 20px 4px; /* üst: 12px, yan: 4px, alt: 20px */
    }
    
    /* User mesajları - sağdan margin eklendi */
    .message.user {
        margin-right: 8px;
        max-width: 85%;
    }
    
    /* Agent mesajları - soldan margin */
    .message.agent {
        margin-left: 8px;
        max-width: 85%;
    }
    
    /* Genel mesaj ayarları */
    .message {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .consent-text {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .consent-submit-button {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .consent-footer-links {
        font-size: 11px;
        gap: 8px;
        padding-top: 12px;
        margin-top: 5px;
    }
    
    .chat-header h2 {
        font-size: 16px;
    }
    
    .chat-header p {
        font-size: 12px;
    }
}

/* iPhone 14 Pro ve benzeri cihazlar için özel ayarlar */
@media (max-width: 430px) {
    /* Chat Container - Widget genel yükseklik limiti */
    .chat-container {
        height: 600px; /* iPhone 14 Pro için sabit yükseklik */
        max-height: 95vh; /* Ekran boyutundan büyük olmasın */
        margin: 10px auto;
    }
    
    .consent-container {
        margin: 6px;
        padding: 16px 10px;
        max-height: 92vh; /* Footer linkler kesinlikle görünsün */
    }
    
    .chat-messages {
        padding: 10px 2px 20px 2px; /* üst: 10px, yan: 2px, alt: 20px */
    }
    
    .message.user {
        margin-right: 6px;
        max-width: 88%;
    }
    
    .message.agent {
        margin-left: 6px;
        max-width: 88%;
    }
}


/* Remove yellow focus outline */
.chat-container *:focus,
.chat-container *:focus-visible {
    outline: none !important;
}

.consent-checkbox:focus,
.consent-checkbox:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(18, 79, 144, 0.3) !important;
}
