/* Trending Page Specific Styles */

.logo a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo a:hover {
    color: #5e60ce;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #5e60ce;
    background: rgba(94, 96, 206, 0.1);
}

.nav-link.active {
    color: #5e60ce;
    background: rgba(94, 96, 206, 0.15);
}

/* Trending Container */
.trending-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    width: 100%;
}

/* Search and Sort Bar */
.search-sort-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    position: relative;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    color: #333;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #5e60ce;
    box-shadow: 0 0 0 3px rgba(94, 96, 206, 0.1);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sort-select {
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.sort-select:hover,
.sort-select:focus {
    border-color: #5e60ce;
    outline: none;
}

.sort-select:focus {
    box-shadow: 0 0 0 3px rgba(94, 96, 206, 0.1);
}

.trending-header {
    text-align: center;
    margin-bottom: 2rem;
}

.trending-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.trending-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:hover {
    border-color: #5e60ce;
}

.filter-select:focus {
    outline: none;
    border-color: #5e60ce;
    box-shadow: 0 0 0 3px rgba(94, 96, 206, 0.1);
}

/* Palettes Grid */
.palettes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Palette Card */
.palette-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.favorite-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorite-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-btn.favorited {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

.palette-colors {
    display: flex;
    height: 200px;
}

.palette-color {
    flex: 1;
    position: relative;
    transition: flex 0.3s ease;
}

.palette-card:hover .palette-color:hover {
    flex: 1.5;
}

.color-hex {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.palette-card:hover .color-hex {
    opacity: 1;
}

.palette-card-info {
    padding: 1rem;
}

.palette-card-info h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.palette-card-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.palette-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #e8ecf3;
    color: #5e60ce;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.palette-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Palette Modal */
.palette-modal-content {
    max-width: 700px;
}

.modal-palette-display {
    display: flex;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.modal-palette-color {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-palette-color:hover {
    flex: 1.3;
}

.modal-color-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-palette-color:hover .modal-color-info {
    opacity: 1;
}

.modal-hex {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.25rem;
}

.modal-rgb {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

.palette-info h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.palette-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Results Counter */
.results-info {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

.results-info strong {
    color: #5e60ce;
    font-weight: 700;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0 1rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #5e60ce;
    color: white;
    border-color: #5e60ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 96, 206, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.page-input {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.page-input:focus {
    outline: none;
    border-color: #5e60ce;
    box-shadow: 0 0 0 3px rgba(94, 96, 206, 0.1);
}

.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* Keyboard Shortcuts Info */
.keyboard-shortcuts-info {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.keyboard-shortcuts-info kbd {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .trending-container {
        padding: 1rem;
    }

    .trending-header h2 {
        font-size: 1.8rem;
    }

    .search-sort-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }

    .sort-group {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
    }

    .filter-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group,
    .filter-select {
        width: 100%;
    }

    .palettes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .palette-colors {
        height: 150px;
    }

    .modal-palette-display {
        height: 180px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .nav-menu {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .pagination-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }

    .pagination-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .pagination-btn span {
        display: none;
    }

    .pagination-btn::after {
        content: attr(data-mobile);
    }

    #firstPageBtn::after {
        content: '⏮️';
    }

    #prevPageBtn::after {
        content: '←';
    }

    #nextPageBtn::after {
        content: '→';
    }

    #lastPageBtn::after {
        content: '⏭️';
    }

    .keyboard-shortcuts-info {
        font-size: 0.8rem;
    }
}
