@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    overflow-y: scroll; /* Убеждаемся, что прокрутка работает */
    -webkit-overflow-scrolling: touch; /* Поддержка прокрутки на iOS */
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(46, 204, 113, 0.15) 0%, transparent 40%);
    z-index: -2;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0) rotate(0deg); }
    100% { transform: translateY(-100vh) translateX(100px) rotate(360deg); }
}

body.aurora-theme::before {
    background: linear-gradient(-45deg, rgba(238, 119, 82, 0.3), rgba(231, 60, 126, 0.3), rgba(35, 166, 213, 0.3), rgba(35, 213, 171, 0.3));
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

body.space-theme::before {
    background-color: #000;
}

body.ocean-theme::before {
    background: linear-gradient(0deg, rgba(0,119,182,0.3) 0%, rgba(0,180,216,0.3) 50%, rgba(144,224,239,0.3) 100%);
}

body.matrix-theme::before {
    background-color: rgba(0, 0, 0, 0.9);
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.left-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 3rem;
}

.logo h1 {
    font-size: 8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, rgb(224, 38, 38), rgb(245, 212, 25));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.2);
    letter-spacing: -2px;
}

.description h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    color: #cccccc;
    letter-spacing: 0.5px;
}

.features ul {
    list-style: none;
}

.features li {
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    color: #aaaaaa;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.features li:hover {
    transform: translateX(5px);
    color: #ffffff;
}

.features li::before {
    content: "•";
    font-size: 1.5rem;
    margin-right: 0.8rem;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.primary-btn {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    color: white;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5);
}

.secondary-btn {
    background-color: rgba(34, 34, 34, 0.7);
    color: white;
    border: 1px solid #333333;
    backdrop-filter: blur(5px);
}

.secondary-btn:hover {
    background-color: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
    transform: translateY(-3px);
}

.secondary-btn i {
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

.right-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-demo {
    width: 100%;
    max-width: 580px;
    background-color: rgba(26, 26, 26, 0.8);
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(37px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.chat-demo:hover {
    transform: translateY(-5px);
}

.chat-header {
    background-color: rgba(34, 34, 34, 0.9);
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.chat-header h3 {
    font-weight: 500;
    color: #eeeeee;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: center;
}

.chat-content {
    padding: 1rem;
    max-height: 375px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    -webkit-overflow-scrolling: touch; /* Поддержка прокрутки на iOS */
}

.chat-content::-webkit-scrollbar {
    width: 6px;
}

.chat-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.chat-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #3498db, #2ecc71);
    border-radius: 3px;
}

.message {
    max-width: 80%;
    padding: 1rem 1.2rem;
    border-radius: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    border-bottom-right-radius: 0.3rem;
}

.bot-message {
    align-self: flex-start;
    background-color: rgba(51, 51, 51, 0.8);
    color: #eeeeee;
    border-bottom-left-radius: 0.3rem;
    border-left: 3px solid #3498db;
}

.typing {
    padding: 1rem;
    background-color: transparent;
    box-shadow: none;
}

.typing-indicator {
    display: flex;
    gap: 0.4rem;
}

.typing-indicator span {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    animation: typing 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-8px); opacity: 1; }
}

.chat-input-container {
    display: flex;
    padding: 1rem;
    background-color: rgba(34, 34, 34, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border-radius: 2rem;
    border: none;
    background-color: rgba(51, 51, 51, 0.8);
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: background-color 0.3s ease;
}

.chat-input:focus {
    background-color: rgba(61, 61, 61, 0.9);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.chat-input::placeholder {
    color: #aaaaaa;
}

.send-button {
    width: 42px;
    height: 42px;
    margin-left: 0.8rem;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ce2927, #dda31b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.send-button:hover {
    transform: scale(1.05);
}

.quick-models {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.quick-model-btn {
    background-color: rgba(51, 51, 51, 0.8);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.quick-model-btn:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.quick-model-btn.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(46, 204, 113, 0.3));
    border-color: #2ecc71;
}

.notification-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(51, 51, 51, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.notification-icon:hover {
    transform: scale(1.1);
}

.notification-icon i {
    color: #ffffff;
    font-size: 1.2rem;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 50%;
    border: 2px solid #1a1a1a;
}

.notification-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    background-color: rgba(26, 26, 26, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.notification-popup.show {
    opacity: 1;
    pointer-events: all;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.2), rgba(46, 204, 113, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-header h4 {
    margin: 0;
    color: #ffffff;
    font-weight: 500;
}

.close-notification {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-notification:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-content {
    padding: 18px;
    color: #cccccc;
    line-height: 1.2;
}

.theme-toggle-btn {
    position: fixed;
    left: 10px;
    bottom: 10px;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    padding: 5px;
    transition: color 0.3s ease;
}

.theme-toggle-btn:hover {
    color: #2196F3;
}

.theme-panel {
    position: fixed;
    left: 10px;
    bottom: 50px;
    width: 280px;
    background-color: rgba(26, 26, 26, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.theme-panel.show {
    opacity: 1;
    pointer-events: all;
}

.theme-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.2), rgba(46, 204, 113, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-panel-header h4 {
    margin: 0;
    color: #ffffff;
    font-weight: 500;
}

.close-theme-panel {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-theme-panel:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-options {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.theme-option:hover {
    transform: translateY(-5px);
}

.theme-option.active::after {
    content: "✓";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.theme-preview {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-option span {
    font-size: 12px;
    color: #aaaaaa;
}

.default-theme { background: radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.15) 0%, transparent 40%), radial-gradient(circle at 80% 70%, rgba(46, 204, 113, 0.15) 0%, transparent 40%); }
.aurora-theme { background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); background-size: 400% 400%; animation: gradient 15s ease infinite; }
.space-theme { background: #000000; }
.space-theme::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 2px); background-size: 50px 50px; opacity: 0.5; }
.ocean-theme { background: linear-gradient(0deg, rgba(0,119,182,1) 0%, rgba(0,180,216,1) 50%, rgba(144,224,239,1) 100%); }
.matrix-theme { background-color: #000; }
.matrix-theme::before { content: "10101"; position: absolute; color: #0f0; font-size: 10px; font-family: monospace; opacity: 0.7; }

.code-block {
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #e0e0e0;
    font-family: monospace;
}

.code-language {
    font-weight: bold;
    color: #333;
}

.code-buttons {
    display: flex;
    gap: 8px;
}

.copy-code-btn, .run-code-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.run-code-btn {
    background-color: #2196F3;
}

.copy-code-btn:hover { background-color: #45a049; }
.run-code-btn:hover { background-color: #0b7dda; }

.code-block pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-output {
    border-top: 1px solid #e0e0e0;
    background-color: #f8f8f8;
    padding: 10px 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.output-header {
    padding: 8px 15px;
    background-color: #e8e8e8;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.fullscreen-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
    font-size: 16px;
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}

.fullscreen-btn:hover {
    color: #2196F3;
}

.chat-demo.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.chat-demo.fullscreen .chat-content {
    flex: 1;
    max-height: none;
}

.clear-history-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(51, 51, 51, 0.8);
    color: #aaaaaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.clear-history-btn:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.welcome-message {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    border: 1px solid rgba(46, 204, 113, 0.3);
    padding: 1rem;
}

.welcome-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
    color: #2ecc71;
}

.welcome-message h4 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
}

.welcome-features {
    list-style: none;
    margin: 0.8rem 0;
    padding-left: 0.5rem;
}

.welcome-features li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.welcome-features li i {
    color: #2ecc71;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 3px solid #e74c3c;
}

.info-message {
    align-self: center;
    background-color: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #aaaaaa;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    max-width: 60%;
}

@media (min-width: 992px) {
    .container {
        flex-direction: row;
        align-items: center;
    }
    .left-section, .right-section {
        flex: 1;
    }
}

@media (max-width: 1200px) {
    .container { padding: 1.5rem; gap: 2rem; }
    .logo h1 { font-size: 6rem; }
    .description h2 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    .logo h1 { font-size: 4rem; }
    .description h2 { font-size: 1.3rem; margin-bottom: 1.5rem; }
    .features li { font-size: 1rem; }
    .chat-content { max-height: 50vh; }
    .notification-popup { width: calc(100% - 40px); right: 20px; }
    .theme-panel { width: calc(100% - 20px); left: 10px; max-width: 350px; }
}

@media (max-width: 390px) { /* Для iPhone 12 Pro Max и подобных */
    .container { padding: 0.8rem; }
    .logo h1 { font-size: 3rem; }
    .description h2 { font-size: 1.1rem; }
    .chat-content { max-height: 40vh; }
    .quick-model-btn { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
    .notification-icon { top: 10px; right: 10px; width: 35px; height: 35px; }
    .notification-popup { top: 55px; right: 10px; width: calc(100% - 20px); }
    .theme-panel { bottom: 40px; width: calc(100% - 20px); max-height: 50vh; overflow-y: auto; }
    .theme-options { grid-template-columns: 1fr; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notification-icon.pulse {
    animation: pulse 1.5s infinite;
}