@import url(https://fonts.googleapis.com/css?family=Lato);
@import url("blender.css");
@import url("chat.css");
@import url("recipes.css");

:root {
    --primary-color: #2c3e50;
    --accent-color: #e74c3c;
    --bg-color: #ecf0f1;
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.main-container.loaded {
    visibility: visible;
    opacity: 1;
}

.blender-section {
    position: relative;
    height: 700px;
    perspective: 1000px;
}

.blender-container {
    position: relative;
    height: 600px;
    width: 350px;
    margin: 0 auto;
    transform-style: preserve-3d;
}

.jar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 
        inset 0 0 20px rgba(255,255,255,0.5),
        0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.jar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px 16px 0 0;
}

.pipe-system {
    position: absolute;
    top: -50px;
    right: 45%;
    width: 30px;
    height: 100px;
}

.pipe {
    position: absolute;
    width: 30px;
    background: rgba(200, 200, 200, 0.8);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    height: 100%;
}

.liquid-stream {
    position: absolute;
    width: 10px;
    left: 10px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s;
    animation: pour 1s linear infinite;
    transform-origin: top;
}

@keyframes pour {
    0% { height: 0; opacity: 0; }
    10% { opacity: 1; }
    100% { height: 100%; opacity: 1; }
}

.liquid-layer {
    position: absolute;
    bottom: 0;
    width: 100%;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom;
}

.controls-panel {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.ingredient-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.ingredient-card:hover {
    transform: translateY(-2px);
}

.recipe-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-mix {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-mix:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.mixing-animation {
    animation: mix 2s ease-in-out;
}

@keyframes mix {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

.ai-assistant {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-assistant:hover {
    transform: scale(1.1);
}

.ai-chat {
    position: fixed;
    bottom: 80px;
    right: 2rem;
    width: 300px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    padding: 1rem;
    display: none;
}

.measurement-tooltip {
    position: absolute;
    right: -150px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.liquid-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.liquid-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    transition: height 1s ease;
    overflow: hidden;
}

#liquid-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.chat-box {
    z-index: 99999;
    height: 90%;
    width: 400px;
    position: fixed;
    margin: 0 auto;
    overflow: hidden;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.005);
    right: 0;
    bottom: 0;
    margin: 15px;
    border-radius: 15px;
    visibility: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.chat-box-header {
    height: 12%;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    align-items: center;
    font-size: 14px;
    padding: 0.5em 0;
    position: relative;
    background: linear-gradient(135deg, #f0f0f0 0%, #ffffff 100%);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.chat-box-header h3 {
    font-family: Ubuntu, sans-serif;
    font-weight: 350;
    position: absolute;
    left: 25px;
    margin: 0;
}

.chat-box-header p {
    float: right;
    position: absolute;
    right: 16px;
    cursor: pointer;
    height: 50px;
    width: 50px;
    text-align: center;
    line-height: 3;
    margin: 0;
    color: #fff;
}

.chat-box-header i {
    color: #000;
}

.chat-box-body {
    height: 75%;
    background: #f8f8f8;
    overflow-y: scroll;
    padding: 12px;
}

.chat-box-body-send {
    width: 250px;
    float: right;
    background: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.015);
    margin-bottom: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.chat-box-body-send p {
    margin: 0;
    color: #444;
    font-size: 14px;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.chat-box-body-send span {
    float: right;
    color: #777;
    font-size: 10px;
}

.chat-box-body-receive {
    width: 250px;
    float: left;
    background: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.015);
    margin-bottom: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.chat-box-body-wait-bubble {
    width: 150px;
    float: left;
    background: white;
    padding: 10px 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.015);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.chat-box-body-receive p {
    margin: 0;
    color: #444;
    font-size: 14px;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.chat-box-body-receive span {
    float: right;
    color: #777;
    font-size: 10px;
}

.chat-box-body::-webkit-scrollbar {
    width: 5px;
    opacity: 0;
}

.chat-box-footer {
    position: relative;
    display: flex;
    background: linear-gradient(135deg, #f0f0f0 0%, #ffffff 100%);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.chat-box-footer button {
    border: none;
    padding: 16px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.chat-box-footer button:focus {
    outline: none;
}

.chat-box-footer input {
    padding: 10px;
    border: none;
    -webkit-appearance: none;
    border-radius: 50px;
    margin: 10px;
    font-family: ubuntu;
    font-weight: 600;
    color: #444;
    width: 280px;
}

.chat-box-footer input:focus {
    outline: none;
}

.chat-box-footer .send {
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    transform: translate(0px, 20px);
    cursor: pointer;
}

.chat-button {
    padding: 25px 16px;
    background: #2c50ef;
    width: 130px;
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 15px;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    border-bottom-left-radius: 25px;
    box-shadow: 0 2px 15px rgba(44, 80, 239, 0.21);
    cursor: pointer;
    z-index: 9999;
}

.chat-button span::before {
    content: "";
    height: 15px;
    width: 15px;
    background: #47cf73;
    position: absolute;
    transform: translate(0, -7px);
    border-radius: 15px;
}

.chat-button span::after {
    content: "Message Us";
    font-size: 14px;
    color: white;
    position: absolute;
    left: 40px;
    top: 13.5px;
}

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 1rem 1.5rem;
    width: 24rem;
    border-radius: 0.5rem;
}

.modal-close-button {
    float: right;
    width: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: lightgray;
}

.close-button:hover {
    background-color: darkgray;
}

.show-modal {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
    z-index: 30;
}

#chat_message {
    width: 85%;
}

.chat-box-body-option {
    width: 250px;
    float: right;
    background: #e6f7ff;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 14px;
    cursor: pointer;
    border: 1px solid #007bff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.chat-box-body-option p {
    margin: 0;
    color: #007bff;
    font-size: 14px;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.chat-box-body-option:hover {
    background: #d0e7ff;
}

.chat-box-body-receive.typing-bubble {
    width: 250px;
    float: left;
    background: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 14px;
}

.chat-box-body-receive.typing-bubble p {
    margin: 0;
    color: #444;
    font-size: 14px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

.chat-box-body-receive.typing-bubble p::after {
    content: "...";
    animation: typing 1.5s infinite;
    margin-left: 2px;
}

@keyframes typing {
    0%, 100% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
}

@media (max-width: 390px) {
    .chat-box {
        min-width: 100% !important;
    }
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1d20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.loader {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(51, 154, 240, 0.2);
    border-top: 5px solid #339af0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    color: #339af0;
    font-size: 16px;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.menu-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.prepare-btn {
    background: rgba(51, 154, 240, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: flex-end;
    margin-top: 8px;
}

.prepare-btn:hover {
    background: rgba(51, 154, 240, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.prepare-btn i {
    font-size: 16px;
}