:root {
    --grey: #f5f5f5;
    --aplyease-primary: #23235b;
    --aplyease-secondary: #4a90e2;
    --aplyease-accent: #28a745;
    --black: #1a1a1a;
    --white: #ffffff;
}

body.chat-open .chat-window {
    display: flex !important;
}

.chat-window {
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    background-color: white;
    border-radius: 20px;
    position: fixed;
    z-index: 999;
    bottom: 60px;
    right: 20px;
    height: 600px;
    width: 360px;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid var(--aplyease-primary);
}

.chat-button {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 998;
    background: linear-gradient(135deg, var(--aplyease-primary) 0%, var(--aplyease-secondary) 100%);
    color: white;
    height: 80px;
    width: 80px;
    border-radius: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(35, 35, 91, 0.3);
    transition: all 0.3s ease;

    img {
        width: 50px;
        filter: brightness(0) invert(1);
    }

    &:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(35, 35, 91, 0.4);
    }
}

.chat-window {
    * {
        font-family: "Raleway", sans-serif;
    }

    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    background-color: white;
    border-radius: 20px;
    position: fixed;
    z-index: 999;
    bottom: 60px;
    right: 20px;
    height: 600px;
    width: 360px;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid var(--aplyease-primary);

    .close {
        border: none;
        padding: 12px 0;
        background: linear-gradient(135deg, var(--aplyease-primary) 0%, var(--aplyease-secondary) 100%);
        color: white;
        border-radius: 18px 18px 0 0;
        cursor: pointer;
        font-weight: 600;
        transition: background 0.3s ease;

        &:hover {
            background: linear-gradient(135deg, var(--aplyease-secondary) 0%, var(--aplyease-primary) 100%);
        }
    }

    .chat {
        flex: 1;
        padding: 16px;
        overflow-y: auto;
        background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);

        p {
            border-radius: 20px;
            width: 80%;
            margin: 12px 0;
            font-size: 14px;
            padding: 16px;
            line-height: 1.4;
            word-wrap: break-word;
        }

        div.model {
            p {
                background: linear-gradient(135deg, var(--grey) 0%, #e9ecef 100%);
                color: var(--black);
                border: 1px solid #dee2e6;
            }
        }

        div.user {
            display: flex;
            justify-content: flex-end;

            p {
                background: linear-gradient(135deg, var(--aplyease-primary) 0%, var(--aplyease-secondary) 100%);
                color: white;
                border: none;
            }
        }

        div.error {
            p {
                font-size: 13px;
                text-align: center;
                color: #dc3545;
                background: #f8d7da;
                border: 1px solid #f5c6cb;
            }
        }
        
        /* Custom scrollbar */
        &::-webkit-scrollbar {
            width: 6px;
        }
        
        &::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }
        
        &::-webkit-scrollbar-thumb {
            background: var(--aplyease-secondary);
            border-radius: 3px;
        }
        
        &::-webkit-scrollbar-thumb:hover {
            background: var(--aplyease-primary);
        }
    }

    .input-area {
        height: 80px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 16px;
        border-top: 2px solid var(--grey);
        background: white;

        input {
            height: 45px;
            flex: 1;
            border: 2px solid var(--grey);
            background-color: white;
            border-radius: 25px;
            padding: 0 20px;
            font-size: 14px;
            transition: border-color 0.3s ease;

            &:focus {
                outline: none;
                border-color: var(--aplyease-secondary);
                box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
            }

            &::placeholder {
                color: #6c757d;
            }
        }

        button {
            height: 45px;
            width: 45px;
            border-radius: 100%;
            border: none;
            margin-left: 12px;
            background: linear-gradient(135deg, var(--aplyease-primary) 0%, var(--aplyease-secondary) 100%);
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s ease;

            img {
                width: 20px;
                filter: brightness(0) invert(1);
            }

            &:hover {
                transform: scale(1.05);
                box-shadow: 0 4px 15px rgba(35, 35, 91, 0.3);
            }

            &:active {
                transform: scale(0.95);
            }
        }
    }
}

.loader {
    width: 40px;
    opacity: 0.6;
    aspect-ratio: 4;
    background: radial-gradient(circle closest-side, var(--aplyease-primary) 90%, #0000) 0/calc(100%/3) 100% space;
    clip-path: inset(0 100% 0 0);
    animation: l1 1.5s steps(4) infinite;
    margin: 10px 0;
}

@keyframes l1 {
    to {
        clip-path: inset(0 -34% 0 0)
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-window {
        width: 320px;
        height: 500px;
        right: 10px;
        bottom: 80px;
    }
    
    .chat-button {
        right: 10px;
        bottom: 80px;
        height: 70px;
        width: 70px;
        
        img {
            width: 40px;
        }
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        height: 450px;
        right: 5px;
        bottom: 70px;
    }
    
    .chat-button {
        right: 5px;
        bottom: 70px;
        height: 60px;
        width: 60px;
        
        img {
            width: 35px;
        }
    }
} 