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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 20px;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.favorites-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-left: 5px;
}

.tab-btn.active .favorites-count {
    background: #667eea;
    color: white;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 15px;
    position: relative;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

.cards-container {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

/* Word Card */
.word-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.4s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.word-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.word-term {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.speaker-btn {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.speaker-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

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

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.favorited {
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
}

.word-definition {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
}

.word-section {
    margin-top: 20px;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #764ba2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.examples-list {
    list-style: none;
    padding: 0;
}

.example-item {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.6);
    border-left: 3px solid #667eea;
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
}

.collocations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.collocation-tag {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Favorites View */
.favorites-header {
    text-align: center;
    margin-bottom: 30px;
}

.favorites-header h2 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 8px;
}

.favorites-subtitle {
    color: #888;
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state-subtext {
    font-size: 1rem;
    color: #bbb;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 20px;
    border-left: 4px solid #c33;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 25px;
    }
    
    .word-card {
        padding: 20px;
    }
    
    .word-term {
        font-size: 1.5rem;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
    }
}
