body {
    min-height: 100vh;
    background-color: #f3f4f6;
    padding: 2rem 1rem;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: #1f2937;
}

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-area {
    margin-bottom: 1.5rem;
}

#searchInput {
    width: 100%;
    font-size: 1.25rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-sizing: border-box;
    resize: vertical;
    min-height: 6rem;
    font-family: inherit;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.button {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.button-primary {
    background-color: #3b82f6;
}

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

.button-danger {
    background-color: #ef4444;
}

.button-danger:hover {
    background-color: #dc2626;
}

#errorMessage {
    color: #ef4444;
    text-align: center;
    margin-bottom: 1rem;
    display: none;
}

#errorMessage.visible {
    display: block;
}

/* Hints Layer */
.hints-layer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    background: white;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    touch-action: pan-x;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.hints-layer.visible {
    display: flex;
    flex-direction: column;
}

.hints-layer.slided {
    transform: translateX(100%);
    pointer-events: none;
}

.hints-tab {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-100%);
    width: 40px;
    height: 120px;
    background: white;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 600;
    color: #3b82f6;
    user-select: none;
    z-index: 1001;
    pointer-events: auto;
}

.hints-content {
    height: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.hints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.hints-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.hints-close {
    padding: 1rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hints-close::after {
    content: '→';
    display: block;
}

.hints-close:hover {
    color: #1f2937;
}

/* Overlay for background */
.hints-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.hints-overlay.visible {
    display: block;
}

/* Search Spinner */
#searchingContainer {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

#searching {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-style: italic;
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.word-info-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #4b5563;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    flex: 1;
    min-height: 0; /* Important for flexbox scrolling */
}

.word-info-text::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

.word-info-text h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-weight: 600;
}

.word-info-text h3:first-child {
    margin-top: 0;
}

.word-info-text p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.word-info-text ul {
    margin-top: 0;
    padding-left: 1.5rem;
}

.word-info-text .error {
    color: #ef4444;
    font-weight: 500;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .hints-content {
        margin: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
}

/* Die Button-Gruppe in der Hints-Layer */
.hints-content .button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-direction: row; /* Standardmäßig nebeneinander */
}

/* Anpassungen für mobile Geräte */
@media (max-width: 640px) {
    .hints-content .button-group {
        flex-direction: column; /* Auf mobilen Geräten untereinander */
    }
}

/* Gemeinsame Button-Stile für Download- und Share-Button */
.button-download,
.button-share {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 60px;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    display: none; /* Standardmäßig ausgeblendet, wird angezeigt, wenn Inhalt verfügbar ist */
}

/* Spezifische Farben für Download-Button */
.button-download {
    background-color: #009900; /* Grüne Farbe */
}

.button-download:hover {
    background-color: #059669; /* Dunkleres Grün beim Hover */
}

/* Spezifische Farben für Share-Button */
.button-share {
    background-color: #336699; /* Blaue Farbe */
}

.button-share:hover {
    background-color: #4f46e5; /* Dunkleres Blau beim Hover */
}

/* Icon-Stil für beide Buttons */
.download-icon,
.share-icon {
    font-size: 1.25rem;
}