/* Keyboard container */
.keyboard-container {
    margin-bottom: 0.5rem;
}

.keyboard {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
    margin-bottom: 0.25rem;
}

/* Keyboard keys */
.key {
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 5px 7px;
    min-width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.key:hover {
    background: linear-gradient(to bottom, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
}

.key .latin {
    color: #64748b;
    font-size: 8px;
    font-weight: 500;
    line-height: 1.2;
}

.key .cyrillic {
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 1px;
}

/* Button toolbar */
.button-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.button-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.button-toolbar button svg {
    flex-shrink: 0;
}

/* Mode indicator */
.mode-indicator {
    margin-left: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
    background-color: #e8f4f8;
    color: #1a5f7a;
    border: 1px solid #1a5f7a;
    border-radius: var(--pico-border-radius);
    font-style: normal;
}

/* Textarea styling */
textarea {
    min-height: 300px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Remove default container padding */
.container {
    padding-top: 0;
}

/* Compact header */
header {
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

header h1 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

header h1 small {
    display: inline;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    color: var(--pico-muted-color);
    font-weight: normal;
}

/* Compact article */
article {
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Compact sections */
section {
    margin-top: 1rem;
}

section h2,
section h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Compact button toolbar */
.button-toolbar {
    margin-bottom: 0.75rem;
}

/* Compact footer */
footer {
    margin-top: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        margin-bottom: 0.25rem;
    }

    header h1 {
        font-size: 1rem;
        line-height: 1.2;
    }

    header h1 small {
        display: block;
        margin-left: 0;
        margin-top: 0.125rem;
        font-size: 0.65rem;
    }

    .key {
        min-width: 35px;
        padding: 6px 8px;
    }

    .key .latin {
        font-size: 9px;
    }

    .key .cyrillic {
        font-size: 14px;
    }

    .button-toolbar button .btn-text {
        display: none;
    }

    .button-toolbar button {
        padding: 0.5rem;
    }

    textarea {
        min-height: 250px;
    }

    article {
        padding: 0.75rem;
    }
}

@media (min-width: 769px) {
    textarea {
        min-height: 400px;
    }
}

@media (min-width: 1024px) {
    textarea {
        min-height: 500px;
    }
}
