/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

.btn-lang {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    min-width: 40px;
    padding: 0.5rem 0.8rem;
}

.btn-lang:hover {
    background: rgba(255,255,255,0.3);
}

.btn-back {
    background: #f0f0f0;
    color: #333;
}

.btn-back:hover {
    background: #e0e0e0;
}

.btn-add {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-add:hover {
    background: #5568d3;
}

.btn-add.added {
    background: #4caf50;
    cursor: default;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
}

.nav-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Main Content */
.app-main {
    padding: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.category-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.category-cover {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    position: relative;
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1.5rem;
    color: white;
}

.category-overlay h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Filter Dropdowns */
.filter-dropdowns {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-dropdown {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    cursor: pointer;
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    transition: all 0.3s;
}

.filter-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-dropdown:hover {
    border-color: #667eea;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.singers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.singer-card {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 1rem;
    border-radius: 12px;
}

.singer-card:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
}

.singer-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
    margin: 0 auto 0.5rem;
    border: 2px solid #f0f0f0;
}

.singer-name {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
}

/* Search */
.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-select {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Songs List */
.songs-view {
    margin-top: 1rem;
}

.songs-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.songs-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.songs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.song-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
    gap: 0.5rem;
}

.song-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.song-info {
    flex: 1;
}

.song-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.song-singer {
    font-size: 0.85rem;
    color: #666;
}

/* Orders Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.order-number {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.order-info {
    flex: 1;
}

.order-song {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.order-singer {
    font-size: 0.9rem;
    color: #666;
}

/* Toast Notification */
.toast {
    display: none;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2000;
    font-size: 0.95rem;
    max-width: 90%;
    text-align: center;
}

.toast-success {
    background: #4caf50;
}

.toast-error {
    background: #f44336;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}

/* Search Results */
.search-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0.75rem 0.5rem;
    flex-wrap: nowrap;
}

.pagination-btn {
    padding: 0.5rem 0.8rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.pagination-info {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

/* Floating Go to Top Button */
.go-to-top {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.9;
}

.go-to-top:hover {
    background: #5568d3;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    opacity: 1;
}

/* Responsive - Mobile First */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem;
    }

    .app-header h1 {
        font-size: 1rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .app-main {
        padding: 0.75rem;
    }

    .nav-tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-width: 50px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .category-cover {
        height: 140px;
    }

    .category-overlay h3 {
        font-size: 1rem;
    }

    .singers-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.75rem;
    }

    .singer-avatar {
        width: 70px;
        height: 70px;
    }

    .singer-name {
        font-size: 0.8rem;
    }

    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-dropdowns {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-dropdown {
        width: 100%;
    }

    .song-item {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .song-item .btn-add {
        width: 100%;
        margin-top: 0.5rem;
    }

    .pagination {
        gap: 0.25rem;
        padding: 0.5rem 0.25rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .pagination-info {
        font-size: 0.75rem;
        padding: 0 0.25rem;
    }

    .go-to-top {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
        bottom: 1.5rem;
        right: 1rem;
    }

    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}

@media (min-width: 769px) {
    .app-header {
        padding: 1.5rem 2rem;
    }

    .app-header h1 {
        font-size: 1.5rem;
    }

    .app-main {
        padding: 2rem;
    }

    .nav-tabs {
        padding: 0 2rem;
    }

    .nav-tab {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .category-cover {
        height: 180px;
    }

    .category-overlay h3 {
        font-size: 1.2rem;
    }

    .singers-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1.5rem;
    }

    .singer-avatar {
        width: 100px;
        height: 100px;
    }

    .singer-name {
        font-size: 0.9rem;
    }

    .song-item {
        padding: 1rem 1.5rem;
        flex-direction: row;
    }

    .song-item .btn-add {
        width: auto;
        margin-top: 0;
    }

    .song-name {
        font-size: 1rem;
    }

    .song-singer {
        font-size: 0.9rem;
    }

    .pagination {
        gap: 1rem;
        padding: 1rem;
    }

    .pagination-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .pagination-info {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
}

