/* Keyboard */
.keyboard-wrapper {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 
        0 10px 30px -10px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.05);
}

.keyboard-container {
    max-width: 900px;
    margin: 0 auto;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    user-select: none;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.keyboard-key {
    position: relative;
    min-width: 48px;
    height: 48px;
    padding: 0.25rem;
    border: none;
    border-radius: 9px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #444;
    font-size: 1.25rem;
    font-family: -apple-system, "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.05),
        -2px -2px 6px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
}

.keyboard-key:hover {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    transform: translateY(-1px);
    box-shadow: 
        4px 4px 10px rgba(0, 0, 0, 0.06),
        -4px -4px 10px rgba(255, 255, 255, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.keyboard-key:active {
    background: linear-gradient(145deg, #f0f0f0, #f8f9fa);
    transform: translateY(1px);
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.05),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

.keyboard-key[data-key="Space"] {
    width: 240px;
    border-radius: 12px;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
}

.keyboard-key[data-key="⌫"],
.keyboard-key[data-key="↵"],
.keyboard-key[data-key="⇧"] {
    min-width: 64px;
    background: linear-gradient(145deg, #e9ecef, #f8f9fa);
    color: #666;
}

/* Language Selector */
.language-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-radius: 16px;
    box-shadow: 
        0 10px 30px -10px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.05);
}

.language-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #555;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.05),
        -2px -2px 6px rgba(255, 255, 255, 0.8);
}

.language-button:hover {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    color: #333;
    transform: translateY(-1px);
    box-shadow: 
        4px 4px 10px rgba(0, 0, 0, 0.06),
        -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.language-button:active {
    background: linear-gradient(145deg, #f0f0f0, #f8f9fa);
    transform: translateY(1px);
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.05),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

.language-button.active {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    box-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.language-button.active:hover {
    background: linear-gradient(145deg, #0056b3, #004d99);
}

/* Results Section */
.results-section {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 
        0 10px 30px -10px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.05);
}

.results-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.results-table {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

.results-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.results-table th {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    color: #444;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1.25rem;
    text-align: left;
    border-bottom: 2px solid #eee;
    position: sticky;
    top: 0;
}

.results-table th:first-child {
    border-top-left-radius: 12px;
}

.results-table th:last-child {
    border-top-right-radius: 12px;
}

.results-table td {
    padding: 1.25rem;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 1px solid #eee;
}

.results-table tbody tr {
    transition: all 0.2s ease;
}

.results-table tbody tr:nth-child(even) {
    background: linear-gradient(145deg, #fcfcfc, #f8f9fa);
}

.results-table tbody tr:hover {
    background: linear-gradient(145deg, #f0f7ff, #e6f3ff);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.results-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Share Dialog */
.share-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.share-dialog-content {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px -20px rgba(0, 0, 0, 0.15),
        0 1px 4px rgba(0, 0, 0, 0.1);
}

.share-dialog-header {
    padding: 1.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 20px 20px 0 0;
}

.share-dialog-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.share-dialog-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f8f9fa;
    color: #666;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.share-dialog-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.share-sections {
    padding: 1.75rem;
}

.share-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.share-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #444;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.05),
        -2px -2px 6px rgba(255, 255, 255, 0.8);
}

.share-option:hover {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    transform: translateY(-1px);
    box-shadow: 
        4px 4px 10px rgba(0, 0, 0, 0.06),
        -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.share-option.primary {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
}

.share-option.primary:hover {
    background: linear-gradient(145deg, #0056b3, #004d99);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
}

.share-button {
    padding: 0.9rem 1.75rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #444;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.05),
        -2px -2px 6px rgba(255, 255, 255, 0.8);
}

.share-button:hover {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    transform: translateY(-1px);
    box-shadow: 
        4px 4px 10px rgba(0, 0, 0, 0.06),
        -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.share-button.system-share {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
}

.share-button.system-share:hover {
    background: linear-gradient(145deg, #0056b3, #004d99);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .keyboard-key {
        min-width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .keyboard-key[data-key="Space"] {
        width: 180px;
    }

    .keyboard-key[data-key="⌫"],
    .keyboard-key[data-key="↵"],
    .keyboard-key[data-key="⇧"] {
        min-width: 54px;
    }

    .language-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .results-section {
        padding: 1.5rem;
    }

    .results-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .results-table th,
    .results-table td {
        padding: 1rem;
        font-size: 1rem;
    }

    .share-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .share-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .keyboard-wrapper,
    .language-selector,
    .results-section {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 12px;
    }

    .keyboard-key {
        min-width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .language-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}
