/* Radio Control Panel – white background, blue accents. v1.2.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #1a73e8;
    --primary-hover: #1558b0;
    --primary-light: #e8f0fe;
    --text: #202124;
    --text-muted: #5f6368;
    --border: #dadce0;
    --bg: #ffffff;
    --bg-page: #f0f4f8;
    --danger: #d93025;
    --danger-hover: #b71c1c;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-page);
}

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

a:hover {
    text-decoration: underline;
}

/* ----- Login page ----- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, #e8f0fe 0%, #f0f4f8 50%, #e2e8f0 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(26, 115, 232, 0.08);
}

.login-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.login-logo {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.login-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    letter-spacing: -0.02em;
}

.login-card .login-subtitle {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.login-form label {
    display: block;
    margin-top: 1.1rem;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.login-form .btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.login-form .btn:hover {
    text-decoration: none;
}

.error-msg {
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    background: #fce8e6;
    color: var(--danger);
    border-radius: 6px;
    font-size: 0.9rem;
}

.success-msg {
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    background: #e6f4ea;
    color: #137333;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    text-decoration: none;
    color: var(--primary-hover);
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

/* ----- Dashboard ----- */
.dashboard-page {
    min-height: 100vh;
    background: var(--bg-page);
}

.topbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.topbar-nav {
    display: flex;
    gap: 0.25rem;
}

.topbar-link {
    padding: 0.5rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.topbar-link:hover {
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
}

.topbar-link-active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.topbar-link-active:hover {
    color: var(--primary-hover);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn {
    margin-right: 0;
}

.dashboard-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-head h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stations-table-wrap {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stations-table {
    width: 100%;
    border-collapse: collapse;
}

.stations-table th,
.stations-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.stations-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-page);
}

.stations-table tbody tr:hover {
    background: rgba(26, 115, 232, 0.03);
}

.stations-table tbody tr:last-child td {
    border-bottom: none;
}

.stations-empty-cell {
    text-align: center;
    padding: 2.5rem 1rem !important;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stations-empty-cell a {
    font-weight: 500;
}

.stations-table tbody tr.dragging {
    opacity: 0.6;
}

.stations-table tbody tr.drag-over {
    background: rgba(26, 115, 232, 0.06);
}

.col-drag {
    width: 2.5rem;
    cursor: grab;
    user-select: none;
}

.col-drag:active {
    cursor: grabbing;
}

.drag-handle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.col-logo {
    width: 56px;
}

.station-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.station-thumb-placeholder {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: var(--bg-page);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.col-name {
    font-weight: 500;
}

.col-url code,
.col-api code {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.col-actions {
    white-space: nowrap;
}

.col-actions .btn,
.col-actions .form-inline {
    margin-right: 0.25rem;
}

.form-inline {
    display: inline;
}

.form-inline button {
    margin: 0;
}

/* Station form */
.station-form label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.station-form input[type="text"],
.station-form input[type="url"],
.station-form input[type="file"] {
    width: 100%;
    max-width: 480px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.station-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    margin-top: 1.5rem;
}

.form-actions .btn {
    margin-right: 0.5rem;
}

.current-logo {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.current-logo .station-thumb {
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* Roundup admin */
.roundup-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.roundup-add {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    max-width: 640px;
}

.roundup-add h2,
.roundup-list h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.roundup-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.roundup-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.roundup-form input[type="url"] {
    width: 100%;
    max-width: 480px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.roundup-form input[type="url"]:focus {
    outline: none;
    border-color: var(--primary);
}

.roundup-wordcount {
    margin: 0.5rem 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.roundup-wordcount.over-limit {
    color: var(--danger);
}

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

.roundup-post-item {
    background: var(--bg);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.roundup-post-content {
    margin: 0 0 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.roundup-post-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.roundup-post-meta .form-inline {
    margin-left: auto;
}

.roundup-post-meta-inline {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
}

/* Managers (admin only) */
.managers-add {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    max-width: 400px;
}

.managers-add h2,
.managers-list h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.managers-list table {
    margin-top: 0.5rem;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-badge.role-admin {
    background: rgba(26, 115, 232, 0.15);
    color: var(--primary);
}

.role-badge.role-manager {
    background: var(--bg-page);
    color: var(--text-muted);
}

/* Public roundup page (shareable at /roundup/) */
.roundup-public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.roundup-public-header {
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.5rem 1.25rem;
    text-align: center;
}

.roundup-public-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.roundup-public-logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 96px;
    object-fit: contain;
    object-position: center;
}

.roundup-public-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.roundup-public-header .roundup-public-title,
.roundup-public-header h1 {
    margin: 0 0 0.2rem;
    font-size: 1.35rem;
    font-weight: 600;
}

.roundup-public-tagline {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.roundup-public-main {
    flex: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
}

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

.roundup-public-post {
    background: var(--bg);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.roundup-public-content {
    margin: 0 0 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.roundup-embed {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.roundup-embed-youtube {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.roundup-embed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.roundup-embed-x {
    max-width: 100%;
}

.roundup-embed-x .twitter-tweet {
    margin: 0 auto;
}

.roundup-public-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.roundup-public-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.roundup-public-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.roundup-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.roundup-public-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.roundup-public-footer a {
    color: var(--text-muted);
}

.roundup-public-copyright {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.roundup-public-copyright a {
    color: var(--text-muted);
}

/* Roundup public: like (reactions) + share */
.roundup-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.roundup-reactions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.roundup-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-page);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.roundup-reaction-btn:hover {
    background: var(--primary-light);
    border-color: rgba(26, 115, 232, 0.3);
    color: var(--primary);
}

.roundup-reaction-btn.is-active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.roundup-reaction-emoji {
    line-height: 1;
}

.roundup-reaction-count {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 0.9em;
    text-align: left;
}

.roundup-share-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.roundup-share-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.roundup-edit-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.roundup-edit-img-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.roundup-edit-img-wrap input[type="checkbox"] {
    margin: 0;
}

.roundup-edit-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
