/* Mobile-First Design - Optimized for Pixel 7a (6.1" screen) */

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

:root {
    --primary: #1a5f7a;
    --secondary: #159895;
    --accent: #57c5b6;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

#app {
    max-width: 100vw;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0.75rem 1rem 0.5rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Category Navigation */
.category-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    background: white;
    box-shadow: 0 2px 4px var(--shadow);
    position: sticky;
    top: 3.1rem;
    z-index: 90;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.category-btn:active {
    transform: scale(0.95);
}

.category-btn.active {
    background: var(--primary);
    color: white;
}

/* Search Input */
.search-container {
    padding: 0 1rem 1rem;
    background: white;
    position: sticky;
    top: calc(3.1rem + 4rem);
    z-index: 85;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text);
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

/* Phrases Container */
.phrases-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Phrase Card */
.phrase-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.phrase-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px var(--shadow);
}

.phrase-card.hidden {
    display: none;
}

.phrase-category-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--secondary);
    background: rgba(21, 152, 149, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.phrase-pt {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.phrase-ipa {
    font-size: 1.1rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0.75rem;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.phrase-en {
    font-size: 1rem;
    color: var(--text);
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    #app {
        max-width: 600px;
        margin: 0 auto;
    }

    header h1 {
        font-size: 2rem;
    }
}
