/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: last 4 version
*/

/* Основні стилі */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('1.png') center/cover;
    -webkit-filter: blur(3px);
            filter: blur(3px);
    z-index: -1;
}
#mediaElement {
    width: 100vw;
    height: 100vh;
    -o-object-fit: cover;
       object-fit: cover;
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mic-button {
    position: fixed;
    bottom: 30px;
    left: 50%;
    -webkit-transform: translateX(-50%);
        -ms-transform: translateX(-50%);
            transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #22c55e;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
            box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    will-change: transform, background-color;
}

.mic-button:hover {
    background: #22c55e;
    -webkit-transform: translateX(-50%) scale(1.1);
        -ms-transform: translateX(-50%) scale(1.1);
            transform: translateX(-50%) scale(1.1);
}

.mic-button.recording {
    background: #ef4444;
    -webkit-animation: pulse 1.5s infinite;
            animation: pulse 1.5s infinite;
}

.mic-button.processing {
    background: #f59e0b;
    -webkit-animation: spin 1s linear infinite;
            animation: spin 1s linear infinite;
}

.mic-button.disabled {
    background: #6b7280;
    cursor: not-allowed;
    -webkit-transform: translateX(-50%);
        -ms-transform: translateX(-50%);
            transform: translateX(-50%);
}

/* Анімації */
@-webkit-keyframes pulse {
    0% {
        -webkit-box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
                box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        -webkit-box-shadow: 0 0 0 20px rgba(34, 197, 94, 0);
                box-shadow: 0 0 0 20px rgba(34, 197, 94, 0);
    }
    100% {
        -webkit-box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
                box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}
@keyframes pulse {
    0% {
        -webkit-box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
                box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        -webkit-box-shadow: 0 0 0 20px rgba(34, 197, 94, 0);
                box-shadow: 0 0 0 20px rgba(34, 197, 94, 0);
    }
    100% {
        -webkit-box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
                box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

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

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

/* Початковий екран */
.init-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    z-index: 2000;
    color: white;
    cursor: pointer;
}

.init-overlay.hidden {
    display: none;
}

.init-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.init-icon {
    font-size: 48px;
    margin-bottom: 20px;
    -webkit-animation: pulse 2s infinite;
            animation: pulse 2s infinite;
}

.init-title {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.init-subtitle {
    font-size: 16px;
    opacity: 0.7;
    line-height: 1.5;
}

/* Чат */
.chat-button {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3b82f6;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
            box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.chat-button:hover {
    background: #2563eb;
    -webkit-transform: scale(1.1);
        -ms-transform: scale(1.1);
            transform: scale(1.1);
}

.chat-modal {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 500px;
    background: -webkit-gradient(linear, left top, left bottom, from(#1e293b), to(#0f172a));
    background: -o-linear-gradient(top, #1e293b, #0f172a);
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-radius: 16px;
    -webkit-box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.5);
    z-index: 2000;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    overflow: hidden;
    -webkit-backdrop-filter: blur(20px);
            backdrop-filter: blur(20px);
}

.chat-modal.hidden {
    display: none;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
    background: -webkit-gradient(linear, left top, right top, from(rgba(59, 130, 246, 0.2)), to(rgba(147, 51, 234, 0.2)));
    background: -o-linear-gradient(left, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    background: linear-gradient(to right, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    position: relative;
}

.chat-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.chat-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    -webkit-transition: color 0.2s;
    -o-transition: color 0.2s;
    transition: color 0.2s;
}

.chat-close:hover {
    color: white;
}

.chat-messages {
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

.message {
    max-width: 80%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 4px;
    -webkit-animation: fadeIn 0.3s ease;
            animation: fadeIn 0.3s ease;
}

.message.user {
    -ms-flex-item-align: end;
        align-self: flex-end;
    -webkit-box-align: end;
        -ms-flex-align: end;
            align-items: flex-end;
}

.message.avatar {
    -ms-flex-item-align: start;
        align-self: flex-start;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-start;
}

.message-sender {
    font-size: 12px;
    color: #94a3b8;
}

.message-content {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.message.user .message-content {
    background: #3b82f6;
    color: white;
}

.message.avatar .message-content {
    background: #374151;
    color: white;
}

.chat-input {
    padding: 16px;
    border-top: 1px solid rgba(71, 85, 105, 0.5);
    background: rgba(30, 41, 59, 0.5);
}

.input-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 8px;
    -webkit-box-align: end;
        -ms-flex-align: end;
            align-items: flex-end;
}

.text-input {
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    padding: 12px 16px;
    background: rgba(71, 85, 105, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    outline: none;
    -webkit-transition: all 0.2s;
    -o-transition: all 0.2s;
    transition: all 0.2s;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.text-input::-webkit-scrollbar {
    display: none;
}

.text-input:focus {
    border-color: #3b82f6;
    -webkit-box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.text-input::-webkit-input-placeholder {
    color: #94a3b8;
}

.text-input::-moz-placeholder {
    color: #94a3b8;
}

.text-input:-ms-input-placeholder {
    color: #94a3b8;
}

.text-input::-ms-input-placeholder {
    color: #94a3b8;
}

.text-input::placeholder {
    color: #94a3b8;
}

.send-button {
    width: 48px;
    height: 48px;
    background: #3b82f6;
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    -webkit-transition: background 0.2s;
    -o-transition: background 0.2s;
    transition: background 0.2s;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

.send-button:hover {
    background: #2563eb;
}

/* Статус */
.status {
    position: fixed;
    top: 20px;
    left: 50%;
    -webkit-transform: translateX(-50%);
        -ms-transform: translateX(-50%);
            transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 1000;
    font-size: 14px;
    -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status.hidden {
    display: none;
}

/* Анімації */
@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(10px);
                transform: translateY(10px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(10px);
                transform: translateY(10px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
}



.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    z-index: 3001;
    color: #fff;
    -webkit-transition: opacity 0.5s;
    -o-transition: opacity 0.5s;
    transition: opacity 0.5s;
}


.loader-overlay.hidden {
  display: none;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #334155;
  border-top: 6px solid #22c55e;
  border-radius: 50%;
  -webkit-animation: loader-spin 1s linear infinite;
          animation: loader-spin 1s linear infinite;
  margin-bottom: 24px;
  -webkit-box-shadow: 0 8px 40px 0 #22c55e44;
          box-shadow: 0 8px 40px 0 #22c55e44;
}

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

@keyframes loader-spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
.loader-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #e2e8f0;
  text-align: center;
  text-shadow: 0 2px 16px rgba(34,197,94,0.15);
}

/* Адаптивність */
@media (max-width: 768px) {
    .chat-modal {
        left: 50% !important;
        -webkit-transform: translateX(-50%) !important;
            -ms-transform: translateX(-50%) !important;
                transform: translateX(-50%) !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 90vw !important;
        max-width: 90vw !important;
        height: 40vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-box-sizing: border-box !important;
                box-sizing: border-box !important;
        border: none !important;
  }
    .init-content {
        padding: 20px;
    }

    .init-title {
        font-size: 20px;
    }

    .init-subtitle {
        font-size: 14px;
    }
}