* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #4a4a4a 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-wrapper {
    width: 100%;
    max-width: 700px;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-in;
    overflow: hidden;
}

.app-header {
    padding: 2rem 2.5rem 1.5rem;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.header-text {
    flex: 1;
    text-align: center;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.5px;
}

.app-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0;
}

.language-selector {
    flex-shrink: 0;
}

.language-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231f2937' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2rem;
}

.language-select:hover {
    border-color: var(--primary-color);
}

.language-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.app-footer {
    background: var(--bg-primary);
    padding: 1.5rem 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.footer-separator {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Help page styles */
.help-container {
    max-width: 900px;
}

.help-container .app-main {
    padding: 2.5rem;
}

.help-content {
    margin-bottom: 2rem;
}

.help-section {
    margin-bottom: 2.5rem;
}

.help-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.help-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.help-section p {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.help-section ul,
.help-section ol {
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    line-height: 1.7;
}

.help-section li {
    margin-bottom: 0.5rem;
}

.example-list {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.example-list li {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.help-footer-actions {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.support-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.support-container p {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.back-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.input-container {
    flex-shrink: 0;
}

.copy-url-container {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    animation: fadeIn 0.3s ease-in;
}

.copy-url-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: var(--shadow-md);
}

.copy-url-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.copy-url-btn:active {
    transform: translateY(0);
}

.copy-url-btn.copied {
    background: #10b981;
}

.copy-url-btn.copied:hover {
    background: #059669;
}

.copy-icon {
    font-size: 1.1rem;
}

.copy-text {
    user-select: none;
}

#inputWord {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
    font-weight: 500;
}

#inputWord:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#inputWord::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

thead {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover:not(.empty-row) {
    background-color: var(--bg-secondary);
}

tbody tr.empty-row td {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

tbody tr:not(.empty-row) td:first-child {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
    width: 80px;
}

tbody tr:not(.empty-row) td:nth-child(2) {
    color: var(--text-primary);
}

.pronounce-cell {
    width: 60px;
    text-align: center;
    padding: 0.5rem !important;
}

.pronounce-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    padding: 0;
    outline: none;
}

.pronounce-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.pronounce-btn:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .app-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-text {
        width: 100%;
    }
    
    .language-selector {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .language-select {
        width: auto;
        min-width: 80px;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .app-header .subtitle {
        font-size: 0.85rem;
    }
    
    .app-main {
        padding: 1.5rem;
    }
    
    .help-container .app-main {
        padding: 1.5rem;
    }
    
    .app-footer {
        padding: 1rem 1.5rem;
    }
    
    .help-section h2 {
        font-size: 1.25rem;
    }
    
    .help-section h3 {
        font-size: 1.1rem;
    }
    
    .app-footer {
        padding: 1rem;
    }
    
    .footer-content {
        gap: 0.75rem;
    }
    
    .footer-text,
    .footer-link,
    .footer-separator {
        font-size: 0.9rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    #inputWord {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .copy-url-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    tbody tr:not(.empty-row) td:first-child {
        font-size: 1rem;
        width: 60px;
    }
    
    .pronounce-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .app-header {
        padding: 1rem 1.25rem 0.75rem;
    }
    
    .header-content {
        gap: 0.75rem;
    }
    
    .language-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
        padding-right: 1.75rem;
    }
    
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .app-header .subtitle {
        font-size: 0.8rem;
    }
    
    .app-main {
        padding: 1.25rem;
    }
    
    .help-container .app-main {
        padding: 1.25rem;
    }
    
    .app-footer {
        padding: 0.75rem 1.25rem;
    }
    
    .help-section h2 {
        font-size: 1.1rem;
    }
    
    .help-section h3 {
        font-size: 1rem;
    }
    
    .app-footer {
        padding: 0.75rem;
    }
    
    .footer-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .footer-text,
    .footer-link,
    .footer-separator {
        font-size: 0.85rem;
    }
    
    .footer-separator {
        display: inline;
    }
    
    .copy-url-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .copy-icon {
        font-size: 1rem;
    }
    
    th, td {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
    
    tbody tr:not(.empty-row) td:first-child {
        font-size: 0.95rem;
    }
    
    .pronounce-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .pronounce-cell {
        width: 50px;
        padding: 0.375rem !important;
    }
}

/* Smooth animations */
tbody tr {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

