﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    
}

.section_keyboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
    .section_keyboard.is-hidden {
        display: none !important;
    }

#virtual-keyboard, #virtual-keyboard .keyboard, #virtual-keyboard .key {
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
#virtual-keyboard {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999999 !important;
    /* чтобы не вылезала за экран на маленьких */
    max-height: 45vh;
    /*overflow: auto;*/
    /* центрирование и аккуратный вид */
    padding: 12px;
    pointer-events: auto;
}

    /* ограничим ширину корпуса и выровняем */
    #virtual-keyboard .container-keyboard {
        max-width: 95vw;
        margin: 0 auto;
    }

    /* скрытие */
    #virtual-keyboard.is-hidden {
        display: none !important;
    }


.input-section {
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
}

.text-input {
    width: 100%;
    padding: 20px 25px;
    font-size: 18px;
    border: none;
    border-radius: 15px;
    background: #0000008a;
    backdrop-filter: blur(20px);
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    outline: none;
}

    .text-input:focus {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }

    .text-input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

.container-keyboard {
    perspective: 1000px;
    width: 100vw;
}

.keyboard {
    background: #0000008a;
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.keyboard-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    justify-content: center;
}

    .keyboard-row:last-child {
        margin-bottom: 0;
    }

.key {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    height: 45px;
    min-width: 45px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    overflow: hidden;
}

    .key::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .key:hover {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }

        .key:hover::before {
            left: 100%;
        }

    .key:active {
        transform: translateY(0) scale(0.98);
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    }

    .key.active {
        background: linear-gradient(145deg, #4facfe, #00f2fe);
        color: white;
        box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
        transform: translateY(-1px);
    }

    .key span {
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 1.2;
    }

    .key.punctuation span {
        font-size: 12px;
    }

    .key.letter {
        text-transform: lowercase;
        font-weight: 600;
        font-size: 16px;
    }

        .key.letter.uppercase {
            text-transform: uppercase;
        }

    /* Размеры клавиш */
    .key.extra-size {
        min-width: 70px;
    }

    .key.extra-size-two {
        min-width: 85px;
    }

    .key.double-size {
        min-width: 110px;
    }

    .key.space-bar {
        min-width: 300px;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    }

        .key.space-bar::after {
            content: 'SPACE';
            font-size: 12px;
            color: rgba(255, 255, 255, 0.7);
            font-weight: 500;
        }

    /* Системные клавиши */
    .key.system {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.lower-row-text {
    font-size: 10px;
    opacity: 0.8;
}

.absolute-right {
    position: absolute;
    right: 8px;
    font-size: 9px;
    opacity: 0.6;
}

.absolute-left {
    position: absolute;
    left: 4px;
    font-size: 16px;
}

.caps-dot {
    color: #3a3a3a;
    transition: color 0.3s ease;
}

    .caps-dot.active {
        color: #ff4757;
        text-shadow: 0 0 10px #ff4757;
    }

/* Responsive дизайн */
@media (max-width: 768px) {
    .keyboard {
        padding: 15px;
        margin: 0 10px;
    }

    .key {
        height: 40px;
        min-width: 40px;
        font-size: 12px;
    }

        .key.space-bar {
            min-width: 200px;
        }

        .key.double-size {
            min-width: 80px;
        }

        .key.extra-size {
            min-width: 60px;
        }

        .key.extra-size-two {
            min-width: 70px;
        }

    .text-input {
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .keyboard-row {
        gap: 4px;
    }

    .key {
        height: 35px;
        min-width: 35px;
        font-size: 11px;
    }

        .key.space-bar {
            min-width: 150px;
        }
}

/* Анимация печати */
@keyframes typeGlow {
    0% {
        box-shadow: 0 0 5px rgba(79, 172, 254, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(79, 172, 254, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(79, 172, 254, 0.5);
    }
}

.key.typing {
    animation: typeGlow 0.3s ease;
}

/* Подсказка */
.hint {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}
