/* Search Page Styles */
.search-page {
    min-height: 100vh;
    padding-top: 20px;
}

/* Apply same background and logo styles as homepage */
body {
    background: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.9)), url('../background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

[data-theme="dark"] body {
    background: linear-gradient(rgba(26,26,26,0.9), rgba(26,26,26,0.9)), url('../background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Logo styling */
.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color);
}

.logo-image {
    height: 90px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--text-color);
    line-height: 1.1;
}

.logo-text h1 .world-radio {
    color: #ff6b35;
    display: block;
}

.logo-text h1 .stream {
    color: #4a90e2;
    display: block;
    margin-top: -2px;
}

.logo-text .tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Search Header */
.search-header {
    text-align: center;
    padding: 40px 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 40px;
}

.search-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.search-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Search Filters */
.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.apply-btn, .clear-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

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

.apply-btn:hover {
    background: var(--primary-dark);
}

.clear-btn {
    background: var(--bg-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.clear-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

/* Results Section */
.search-results {
    padding: 20px 0;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#results-count {
    color: var(--text-muted);
    font-weight: 500;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

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

/* Results Grid View */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.results-grid .station-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.results-grid .station-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.results-grid .station-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
}

.results-grid .station-card h3 {
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 1.2rem;
}

.results-grid .station-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Results List View */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.station-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.station-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.results-list .station-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    object-fit: cover;
    flex-shrink: 0;
}

.station-info {
    flex: 1;
}

.station-info h3 {
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 1.1rem;
}

.station-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Listen Button */
.listen-btn {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    display: inline-block;
    flex-shrink: 0;
}

.listen-btn:hover {
    background: var(--primary-dark);
    color: white;
}

.results-list .listen-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Loading and No Results */
.loading-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-message .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 1.5rem;
}

.no-results p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.back-home-btn {
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.back-home-btn:hover {
    background: var(--primary-dark);
    color: white;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        min-width: auto;
        width: 100%;
    }
    
    .results-info {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .station-row {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .results-list .station-logo {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .search-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .search-header {
        padding: 30px 15px;
    }
    
    .search-header h1 {
        font-size: 1.8rem;
    }
    
    .apply-btn, .clear-btn {
        width: 100%;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .filter-group select {
        background: var(--bg-secondary);
    }
    
    .station-card, .station-row {
        background: var(--bg-color);
    }
}

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