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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

//.header {
//    text-align: center;
//    margin-bottom: 40px;
//    animation: fadeInDown 0.8s ease-out;
//}

.header {
    margin-bottom: 0.3rem;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    max-width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

.header-text {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-text h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.app-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.search-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.language-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 8px;
    position: relative;
}

.toggle-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.toggle-btn.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 18px 60px 18px 24px;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    font-size: 18px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 20px;
}

.search-stats {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
}

.results-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.results-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    font-size: 18px;
    font-weight: 600;
}

.results-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0;
}

.result-item {
    padding: 20px 30px;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.result-content {
    flex: 1;
}

.result-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.result-item:last-child {
    border-bottom: none;
}

.result-word {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.result-translation {
    font-size: 16px;
    color: #6c757d;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-btn, .tts-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover, .tts-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tts-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.tts-btn:hover {
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.tts-btn.playing {
    background: linear-gradient(135deg, #fd7e14 0%, #e83e8c 100%);
    animation: pulse 1s infinite;
}

.tts-btn.playing:hover {
    box-shadow: 0 4px 15px rgba(253, 126, 20, 0.4);
}

.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #6c757d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.empty-subtitle {
    font-size: 16px;
    line-height: 1.5;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

//.footer {
//    text-align: center;
//    margin-top: 30px;
//    color: rgba(255, 255, 255, 0.7);
//    font-size: 14px;
//}

footer {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

.search-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    gap: 10px;
}

.search-mode-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9ecef;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:focus + .slider {
    box-shadow: 0 0 1px #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.search-mode-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    gap: 10px;
}

.search-mode-select {
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid #e9ecef;
    background-color: #f8f9fa;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.search-mode-select:hover {
    border-color: #667eea;
}

.search-mode-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 2px;
    border-radius: 4px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content {
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .logo {
        height: 36px;
    }

    .header-text h1 {
        font-size: 1.3rem;
    }


    .app-title {
        font-size: 2rem;
    }

    .search-container {
        padding: 20px;
    }

    .search-input {
        padding: 16px 50px 16px 20px;
        font-size: 16px;
    }

    .toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .result-item {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .action-buttons {
        align-self: flex-end;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header-content {
        gap: 0.5rem;
    }

    .logo {
        height: 32px;
    }

    .header-text h1 {
        font-size: 1.1rem;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .app-subtitle {
        font-size: 1rem;
    }

    .search-container {
        padding: 15px;
    }

    .results-header {
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .header-content {
        flex-wrap: nowrap;
    }

    .logo {
        height: 28px;
    }

    .header-text h1 {
        font-size: 1rem;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
