/* Cookie Consent Popup Styles */
.cookie-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    display: none;
    font-family: 'Ubuntu', sans-serif;
}

.cookie-popup.show {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.cookie-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.cookie-description {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 15px;
}

.cookie-settings {
    margin-bottom: 15px;
}

.cookie-option {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    margin: 10px 0;
}

.cookie-option input {
    margin-right: 10px;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.cookie-buttons .btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-accent {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    border: none;
}

.btn-outline-white {
    border: 1px solid #1e3a8a;
    color: #1e3a8a;
    background: transparent;
}

.btn-outline-white:hover {
    background: #1e3a8a;
    color: #fff;
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 85px;
    right: 36px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    border: none;
}

.chat-widget:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.chat-widget i {
    font-size: 1.4rem;
    color: #fff;
}

/* Chat Window Styles */
.chat-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    max-height: 450px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
}

.chat-window.show {
    display: flex;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chat Header Styles */
.chat-header {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

.chat-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-header .admin-status {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    opacity: 0.9;
}

.online-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-left: 6px;
    animation: pulse-dot 2s infinite;
}

.offline-indicator {
    background: #ef4444;
}

.chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages Area Styles */
.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f8fafc;
    max-height: 280px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* User Info Form Styles */
.user-info-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info-form h4 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a8a;
}

.user-info-form p {
    margin: 0 0 12px;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.3;
}

.user-info-form input {
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
}

.user-info-form input:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
}

.user-info-form .form-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.user-info-form button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-form {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
}

.btn-secondary-form {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-primary-form:hover {
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
}

.btn-secondary-form:hover {
    background: #e5e7eb;
}

/* Individual Messages Styles */
.chat-message {
    margin-bottom: 8px;
    max-width: 85%;
    word-wrap: break-word;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.user {
    margin-left: auto;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 8px 12px;
    border-radius: 16px 16px 4px 16px;
    font-size: 0.85rem;
}

.chat-message.admin,
.chat-message.system {
    margin-right: auto;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 16px 16px 16px 4px;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.system {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
    text-align: center;
    margin: 8px auto;
    border-radius: 12px;
}

/* Message Content Styles */
.message-content {
    line-height: 1.4;
}

.message-meta {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.chat-message.user .message-meta {
    color: rgba(255, 255, 255, 0.8);
}

.chat-message.admin .message-meta,
.chat-message.system .message-meta {
    color: #6b7280;
}

/* Message Status Indicators Styles */
.message-status.sending {
    color: #f59e0b;
}

.message-status.sent {
    color: #10b981;
}

.message-status.failed {
    color: #ef4444;
    cursor: pointer;
}

/* Chat Choices Styles */
.chat-choices {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8fafc;
}

.chat-choice {
    background: #fff;
    border: 1px solid #1e3a8a;
    color: #1e3a8a;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.chat-choice:hover {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    transform: translateY(-1px);
}

/* Chat Input Area Styles */
.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 16px 0 0 16px;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}

.chat-input input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.chat-input input::placeholder {
    color: #9ca3af;
}

.chat-input button {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border: none;
    color: #fff;
    width: 40px;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
    transform: scale(1.02);
}

.chat-input button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.chat-input button i {
    font-size: 1.2rem;
}

/* Typing Indicator Styles */
.typing-indicator {
    font-size: 0.75rem;
    color: #6b7280;
    padding: 8px 10px;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    background: #f8fafc;
}

/* Connection Status Styles */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    z-index: 1001;
    display: none;
    color: #fff;
}

.connection-status.connected {
    background: #10b981;
}

.connection-status.disconnected {
    background: #ef4444;
}

.connection-status.reconnecting {
    background: #f59e0b;
}

/* Loading State Styles */
.chat-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #6b7280;
}

.chat-loading i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Responsive Design */

/* Tablet Responsive */
@media (max-width: 768px) {
    .chat-widget {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .chat-widget i {
        font-size: 1.2rem;
    }

    .chat-window {
        width: 100%;
        height: 70vh;
        max-height: 70vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }

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

    .chat-window.minimized .chat-messages,
    .chat-window.minimized .typing-indicator,
    .chat-window.minimized .chat-choices,
    .chat-window.minimized .chat-input {
        display: none;
    }

    .chat-header {
        border-radius: 16px 16px 0 0;
    }

    .chat-close i {
        transition: transform 0.3s ease;
    }

    .chat-window.minimized .chat-close i::before {
        content: "\f067";
    }

    .chat-messages {
        max-height: none;
        flex: 1;
    }

    .chat-choice {
        min-width: 100px;
        font-size: 0.75rem;
    }

    .connection-status {
        left: 10px;
        text-align: center;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        height: 75vh;
        max-height: 75vh;
    }

    .chat-header {
        padding: 10px 12px;
    }

    .chat-header h3 {
        font-size: 0.9rem;
    }

    .admin-status {
        font-size: 0.7rem;
    }

    .chat-messages {
        padding: 8px;
    }

    .chat-message {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .message-meta {
        font-size: 0.65rem;
    }

    .chat-input {
        padding: 8px;
    }

    .chat-input input {
        padding: 6px 10px;
        font-size: 16px;
    }

    .chat-input button {
        width: 36px;
    }

    .user-info-form {
        padding: 10px;
    }

    .user-info-form input {
        padding: 6px 8px;
        font-size: 16px;
    }

    .chat-choice {
        font-size: 0.7rem;
        padding: 5px 8px;
        min-width: auto;
    }

    .chat-choices {
        flex-direction: column;
        padding: 8px;
    }

    .typing-indicator {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 320px) {
    .chat-window {
        height: 80vh;
    }

    .chat-header {
        padding: 8px 10px;
        min-height: 45px;
    }

    .chat-header h3 {
        font-size: 0.85rem;
    }

    .admin-status {
        font-size: 0.65rem;
    }

    .chat-messages {
        padding: 6px;
    }

    .chat-message {
        font-size: 0.75rem;
        padding: 5px 8px;
    }

    .chat-input {
        padding: 6px;
    }

    .chat-input input {
        padding: 5px 8px;
    }

    .chat-input button {
        width: 32px;
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-window {
        height: 85vh;
        max-height: 85vh;
    }
}

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

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}