/* ========================================
   RUFM.NET — Каталог радиостанций
   ======================================== */

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

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #16213e;
    --bg-card: #1a1a2e;
    --bg-hover: #1e2a4a;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --text-muted: #555;
    --border: #2a2a4a;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ======== ШАПКА ======== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.logo i { color: var(--accent); font-size: 24px; }
.logo small { color: var(--accent); font-weight: 400; font-size: 14px; }

.search-form {
    flex: 1;
    max-width: 500px;
    display: flex;
    background: var(--bg-primary);
    border-radius: 50px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.search-form input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 18px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
.search-form input::placeholder { color: var(--text-muted); }
.search-form button {
    background: var(--accent);
    border: none;
    padding: 10px 16px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
.search-form button:hover { background: var(--accent-hover); }

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.user-menu { position: relative; padding-bottom: 10px; }
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
    padding: 8px 0;
    margin-top: 0;
    z-index: 200;
}
.user-menu:hover .user-dropdown,
.user-dropdown:hover { display: block; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
}
.user-dropdown a:hover { background: var(--bg-secondary); color: var(--accent); }

/* ======== LAYOUT ======== */
.site-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px 20px;
    min-height: calc(100vh - 200px);
}

.content-with-sidebar {
    display: flex;
    gap: 30px;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 15px;
}

.sidebar-section h3 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li a {
    display: block;
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-list li a:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ======== СЕКЦИИ ======== */
.section { margin-bottom: 35px; }

.section-title {
    font-size: 22px;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i { color: var(--accent); }

/* ======== СЕТКА СТАНЦИЙ ======== */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.station-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}
.station-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.15);
}

.station-card-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.station-card-logo img { width: 100%; height: 100%; object-fit: cover; }

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(108, 99, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: #fff;
    font-size: 20px;
}
.station-card-logo:hover .play-overlay { opacity: 1; }

.station-card-info { flex: 1; min-width: 0; }

.station-card-name {
    display: block;
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.station-card-name:hover { color: var(--accent); }

.station-card-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.genre-tag { background: rgba(108, 99, 255, 0.15); color: var(--accent); }
.country-tag { background: rgba(39, 174, 96, 0.15); color: var(--success); }

.station-card-stats { display: flex; gap: 12px; }
.stat { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }

.station-card-actions { display: flex; flex-direction: column; gap: 6px; }

.fav-btn, .play-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}
.fav-btn:hover, .fav-btn.active { color: var(--danger); border-color: var(--danger); }
.play-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(108, 99, 255, 0.1); }

/* ======== СТРАНИЦА СТАНЦИИ ======== */
.station-page { max-width: 800px; }

.station-header {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.station-logo-big {
    width: 150px; height: 150px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
}
.station-logo-big img { width: 100%; height: 100%; object-fit: cover; }

.station-info-big h1 { font-size: 28px; color: #fff; margin-bottom: 10px; }

.station-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.station-tags .tag { padding: 4px 12px; font-size: 13px; }

.station-stats-big {
    display: flex; gap: 20px; margin-bottom: 15px;
    font-size: 14px; color: var(--text-secondary);
}

.station-actions-big { display: flex; gap: 10px; flex-wrap: wrap; }

.station-description, .station-contacts {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.station-description h2, .station-contacts h2 { font-size: 18px; color: #fff; margin-bottom: 12px; }

.contacts-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-link {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s;
}
.contact-link:hover { background: var(--accent); color: #fff; }

/* ======== КНОПКИ ======== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 50px; border: none;
    cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all 0.2s; text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }

/* ======== ФОРМЫ ======== */
.auth-page { display: flex; justify-content: center; padding: 40px 0; }
.auth-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 35px;
    width: 100%; max-width: 420px;
}
.auth-card h1 { text-align: center; margin-bottom: 25px; color: #fff; font-size: 24px; }

.auth-form .form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); outline: none; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group small { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); }

.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ======== SUBMIT PAGE ======== */
.submit-page { max-width: 700px; }
.submit-page h1 { font-size: 24px; color: #fff; margin-bottom: 10px; }
.submit-intro { color: var(--text-secondary); margin-bottom: 25px; }
.form-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 25px; margin-bottom: 20px;
}
.form-section h2 {
    font-size: 16px; color: var(--accent);
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

/* ======== ALERTS ======== */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; }
.alert-error { background: rgba(231, 76, 60, 0.1); color: var(--danger); border: 1px solid rgba(231, 76, 60, 0.3); }
.alert-success { background: rgba(39, 174, 96, 0.1); color: var(--success); border: 1px solid rgba(39, 174, 96, 0.3); }

/* ======== EMPTY STATE ======== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 48px; color: var(--text-muted); margin-bottom: 15px; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }

/* ======== TABS ======== */
.tabs { display: flex; gap: 5px; margin-bottom: 20px; }
.tab-btn {
    padding: 10px 20px; border-radius: 50px;
    border: 1px solid var(--border); background: none;
    color: var(--text-secondary); cursor: pointer;
    font-size: 14px; transition: all 0.2s;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ======== TRACKS LIST ======== */
.tracks-list { display: flex; flex-direction: column; gap: 8px; }
.track-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-secondary); border-radius: var(--radius-sm);
}
.track-info { flex: 1; }
.track-info small { color: var(--text-muted); margin-left: 8px; }
.track-actions { display: flex; gap: 5px; }

/* ======== PLAYER BAR ======== */
.player-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 500; padding: 10px 20px;
    display: flex;
    justify-content: center;
}
.player-inner {
    display: flex; align-items: center; gap: 15px;
    max-width: 1400px; margin: 0 auto;
}

.player-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.player-info img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.player-station {
    font-weight: 600; font-size: 14px; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-track {
    font-size: 12px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player-controls { display: flex; align-items: center; gap: 12px; }

.player-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent); border: none; color: #fff;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.player-btn:hover { background: var(--accent-hover); }

.player-volume { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.player-volume input[type="range"] {
    width: 80px; height: 4px;
    -webkit-appearance: none;
    background: var(--border); border-radius: 2px; outline: none;
}
.player-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
}

.player-actions { display: flex; gap: 5px; }
.player-action-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: none;
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: all 0.2s;
}
.player-action-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ======== PLAYER ACTIVE STATE ======== */
body.player-active { padding-bottom: 75px; }

/* ======== АДАПТИВ ======== */
@media (max-width: 1024px) {
    .sidebar { width: 180px; }
    .stations-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 768px) {
    .content-with-sidebar { flex-direction: column; }
    .sidebar {
        width: 100%;
        display: flex;
        gap: 10px;
        overflow-x: auto;
    }
    .sidebar-section { min-width: 200px; margin-bottom: 0; }
    .site-wrapper { padding: 15px; }
    .header-nav .nav-btn span { display: none; }
    .search-form { max-width: 300px; }
    .stations-grid { grid-template-columns: 1fr; }
    .station-header { flex-direction: column; align-items: center; text-align: center; }
    .station-logo-big { width: 120px; height: 120px; }
    .station-info-big h1 { font-size: 22px; }
    .station-tags { justify-content: center; }
    .station-stats-big { justify-content: center; }
    .station-actions-big { justify-content: center; }
    .player-volume { display: none; }
    .player-station { max-width: 120px; }
    .player-track { max-width: 120px; }
    .form-row { grid-template-columns: 1fr; }
    .section-title { font-size: 18px; }
    .auth-card { padding: 25px; }
}

@media (max-width: 480px) {
    .header-inner { gap: 10px; }
    .logo span { display: none; }
    .search-form { max-width: none; flex: 1; }
    .header-nav { gap: 4px; }
    .nav-btn { padding: 8px 10px; }
    .station-card { padding: 10px; }
    .station-card-logo { width: 50px; height: 50px; }
    .player-info img { width: 36px; height: 36px; }
    .player-actions .player-action-btn:not(:first-child) { display: none; }
}