/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Arial', sans-serif;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: url('../img/skiljo/pitaj_lajfkouca.png') center center / cover;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.chat-toggle svg {
    display: none;
}

.chat-toggle::before {
    content: "pitaj lajfkouča";
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #293490 100%);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 1;
    animation: speechBubbleEnhanced 4s ease-in-out infinite;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.chat-toggle::after {
    content: "";
    position: absolute;
    right: 63px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid #293490;
    z-index: 1;
    opacity: 1;
    animation: speechBubbleEnhanced 4s ease-in-out infinite;
    filter: drop-shadow(2px 0 4px rgba(41, 52, 144, 0.3));
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-container.form-active {
    height: 580px;
}

.chat-container.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header-logo {
    height: 32px;
    width: auto;
    max-width: 200px;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.chat-header-logo:hover {
    transform: scale(1.05);
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
}

.chat-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-body {
    height: 400px;
    overflow-y: auto;
    padding: 0;
    flex: 1;
    min-height: 0;
}

.chat-container.form-active .chat-body {
    height: 300px;
}

.chat-messages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    animation: messageSlide 0.3s ease;
}

.message.bot {
    background: #f1f3f4;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    margin-left: 40px;
    position: relative;
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.lajfkouc-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 3px solid #ffffff;
    display: block;
    animation: avatarGlow 3s ease-in-out infinite;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2px;
}

.lajfkouc-avatar:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.insurance-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.insurance-option {
    background: linear-gradient(145deg, #293490 0%, #1e2a6b 100%);
    border: 2px solid #3b4aa0;
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(41, 52, 144, 0.25);
    position: relative;
    overflow: hidden;
}

.insurance-option::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.insurance-option:hover {
    border-color: #4f5db8;
    background: linear-gradient(145deg, #3a4296 0%, #2a3578 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(41, 52, 144, 0.4);
}

.insurance-option:hover::before {
    background: linear-gradient(180deg, #4f5db8 0%, #3a4296 100%);
}

.insurance-option:active {
    transform: translateY(-1px) scale(1.01);
}

.option-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.insurance-option:hover .option-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.advice-icon {
    color: #ffffff;
    width: 28px;
    height: 28px;
    padding: 6px;
}

.insurance-option span {
    font-size: 15px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.insurance-option:hover span {
    color: #f0f4ff;
}

.chat-form {
    padding: 20px;
    background: #f8f9fa;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    flex-shrink: 0;
}

.chat-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 14px;
}

.back-btn:hover {
    background: #5a6268;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes speechBubble {
    0%, 70% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    85% {
        opacity: 0.3;
        transform: translateY(-50%) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@keyframes speechBubbleEnhanced {
    0%, 60% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
        box-shadow: 
            0 8px 25px rgba(102, 126, 234, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    70% {
        opacity: 0.9;
        transform: translateY(-50%) scale(1.05);
        box-shadow: 
            0 12px 35px rgba(102, 126, 234, 0.6),
            0 6px 20px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    80% {
        opacity: 0.7;
        transform: translateY(-52%) scale(0.98);
        box-shadow: 
            0 6px 20px rgba(102, 126, 234, 0.3),
            0 3px 8px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
        box-shadow: 
            0 8px 25px rgba(102, 126, 234, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

@keyframes avatarGlow {
    0%, 50% {
        box-shadow: 
            0 4px 12px rgba(102, 126, 234, 0.3),
            0 2px 6px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    25% {
        box-shadow: 
            0 6px 18px rgba(102, 126, 234, 0.5),
            0 3px 10px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }
    75% {
        box-shadow: 
            0 5px 15px rgba(118, 75, 162, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    100% {
        box-shadow: 
            0 4px 12px rgba(102, 126, 234, 0.3),
            0 2px 6px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        width: 320px;
        height: 450px;
        right: 10px;
    }
    
    .chat-container.form-active {
        height: 520px;
    }
    
    .chat-widget {
        right: 10px;
        bottom: 10px;
    }
    
    .chat-body {
        height: 350px;
    }
    
    .chat-container.form-active .chat-body {
        height: 270px;
    }
    
    .chat-form {
        max-height: 250px;
    }
    
    .insurance-option {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .option-icon {
        width: 28px;
        height: 28px;
    }
    
    .insurance-option span {
        font-size: 14px;
        color: #ffffff;
    }
    
    .chat-toggle::before {
        right: 70px;
        font-size: 11px;
        padding: 8px 12px;
        border-radius: 16px;
        letter-spacing: 0.3px;
    }
    
    .chat-toggle::after {
        right: 58px;
        border-left-width: 10px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }
    
    .message.bot {
        margin-left: 35px;
    }
    
    .lajfkouc-avatar {
        width: 28px;
        height: 28px;
        left: -35px;
        border-width: 2px;
    }
    
    .chat-header-logo {
        height: 28px;
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .chat-widget {
        right: 15px;
        bottom: 15px;
    }
    
    .chat-container {
        width: calc(100vw - 30px);
        right: 0;
        left: auto;
        max-width: 340px;
        height: 400px;
    }
    
    .chat-container.form-active {
        height: 480px;
    }
    
    .chat-body {
        height: 300px;
    }
    
    .chat-container.form-active .chat-body {
        height: 220px;
    }
    
    .chat-form {
        max-height: 200px;
        padding: 15px;
    }
    
    .insurance-option {
        padding: 12px 14px;
        gap: 10px;
        border-radius: 12px;
    }
    
    .option-icon {
        width: 24px;
        height: 24px;
    }
    
    .advice-icon {
        width: 22px;
        height: 22px;
        color: #ffffff;
        padding: 5px;
    }
    
    .insurance-option span {
        font-size: 13px;
        color: #ffffff;
    }
    
    .chat-toggle::before {
        right: 75px;
        font-size: 10px;
        padding: 6px 10px;
        border-radius: 14px;
        letter-spacing: 0.2px;
    }
    
    .chat-toggle::after {
        right: 63px;
        border-left-width: 8px;
        border-top-width: 5px;
        border-bottom-width: 5px;
    }
    
    .message.bot {
        margin-left: 30px;
    }
    
    .lajfkouc-avatar {
        width: 24px;
        height: 24px;
        left: -30px;
        border-width: 2px;
    }
    
    .chat-header-logo {
        height: 24px;
        max-width: 160px;
    }
}

/* Custom scrollbar */
.chat-body::-webkit-scrollbar,
.chat-form::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track,
.chat-form::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-body::-webkit-scrollbar-thumb,
.chat-form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover,
.chat-form::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 