/* Regional Music Fetcher - Frontend Styles */

.rmf-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1100px;
    margin: 0 auto 2rem;
    color: #1a1a2e;
}

/* Header */
.rmf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f0;
}

.rmf-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rmf-title {
    margin: 0 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
}

.rmf-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rmf-market-select,
.rmf-type-select {
    padding: 7px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.rmf-market-select:hover,
.rmf-type-select:hover {
    border-color: #1DB954;
}

/* Search */
.rmf-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.rmf-search-input {
    flex: 1;
    padding: 9px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.rmf-search-input:focus {
    border-color: #1DB954;
}

.rmf-search-btn,
.rmf-clear-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.rmf-search-btn {
    background: #1DB954;
    color: #fff;
}

.rmf-search-btn:hover {
    background: #17a349;
    transform: translateY(-1px);
}

.rmf-clear-btn {
    background: #f0f0f0;
    color: #555;
}

.rmf-clear-btn:hover {
    background: #e0e0e0;
}

/* Loading */
.rmf-loading {
    text-align: center;
    padding: 40px 20px;
    color: #777;
}

.rmf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #1DB954;
    border-radius: 50%;
    animation: rmf-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* Grid */
.rmf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
}

/* Card */
.rmf-card {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rmf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.rmf-card-image {
    position: relative;
    aspect-ratio: 1;
    background: #f5f5f5;
    overflow: hidden;
}

.rmf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.rmf-card:hover .rmf-card-image img {
    transform: scale(1.05);
}

.rmf-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.rmf-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.rmf-card:hover .rmf-card-overlay {
    opacity: 1;
}

.rmf-play-btn {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    background: #1DB954;
    padding: 8px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.rmf-card-info {
    padding: 12px;
}

.rmf-card-name {
    margin: 0 0 4px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a1a2e !important;
}

.rmf-card-artist {
    margin: 0 0 2px !important;
    font-size: 0.78rem !important;
    color: #666 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rmf-card-sub {
    margin: 0 0 2px !important;
    font-size: 0.72rem !important;
    color: #999 !important;
    text-transform: capitalize;
}

.rmf-card-date {
    margin: 4px 0 0 !important;
    font-size: 0.7rem !important;
    color: #1DB954 !important;
    font-weight: 600 !important;
}

/* Error */
.rmf-error {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 16px 20px;
    color: #b91c1c;
}

.rmf-error-hint {
    margin-top: 6px;
    color: #777;
    font-size: 0.85rem;
}

.rmf-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 30px 0;
}

/* Footer */
.rmf-footer-note {
    text-align: center;
    font-size: 0.75rem !important;
    color: #aaa !important;
    margin-top: 18px !important;
}

.rmf-footer-note a {
    color: #1DB954;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
    .rmf-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rmf-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}
