/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Public View */
.public-view {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Public Header */
.public-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.public-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="50" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="30" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
}

.public-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.public-header .logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.public-header .logo h1 {
    font-size: 2rem;
    margin: 0;
    color: white;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.public-header .tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

/* Inline Login Form */
.inline-login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.login-fields input {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    min-width: 120px;
}

.login-fields input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.login-fields .btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.inline-login-form .error-message {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin: 0;
}

/* Public Main Content */
.public-main {
    padding: 40px 0 60px;
    min-height: calc(100vh - 140px);
}

.public-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

/* Rankings Section */
.public-rankings {
    position: sticky;
    top: 20px;
    min-width: 0;
}

/* Rankings header styles (legacy - may not be used with new structure) */
.rankings-header {
    padding: 20px 20px 16px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    text-align: center;
}

.rankings-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Legacy public listener rankings - replaced by public-rankings-list */
.public-listener-rankings {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.public-articles {
    min-width: 0;
}

.public-articles-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* F1 Live Timing Style Ranking Table */
.f1-ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    background: #1a1a1a;
    color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.f1-ranking-table th {
    background: #2d2d2d;
    padding: 8px 12px;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #007bff;
}

.f1-ranking-table td {
    padding: 6px 12px;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s ease;
}

.f1-ranking-table tbody tr:hover {
    background: #2a2a2a;
}

.f1-ranking-table .pos {
    width: 40px;
    text-align: center;
    font-weight: bold;
    color: #ffd700;
}

.f1-ranking-table .pos.first {
    color: #ffd700;
}

.f1-ranking-table .pos.second {
    color: #c0c0c0;
}

.f1-ranking-table .pos.third {
    color: #cd7f32;
}

.f1-ranking-table .name {
    font-weight: 600;
    min-width: 120px;
}

.f1-ranking-table .points {
    text-align: right;
    font-weight: bold;
    color: #00ff00;
    min-width: 60px;
}

.f1-ranking-table .penalty-points {
    text-align: right;
    font-weight: bold;
    color: #ff6b6b;
    min-width: 60px;
}


.ranking-section-title {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding: 8px 0;
    border-bottom: 2px solid #007bff;
    text-align: center;
}

/* Apply ranking title style to program names for consistency */
.ranking-section-title-style {
    color: white !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    text-align: center !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
}

/* Unified program header style matching rankings header */
.program-header-unified {
    padding: 20px 20px 16px !important;
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
    text-align: center !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
}

.program-header-unified::before {
    display: none !important;
}

.no-ranking-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Mobile Layout */
@media (max-width: 968px) {
    .public-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .public-rankings {
        position: static;
        order: -1;
    }
    
    .public-listener-rankings {
        max-height: none;
    }
    
    .f1-ranking-table {
        font-size: 12px;
    }
    
    .f1-ranking-table th,
    .f1-ranking-table td {
        padding: 6px 8px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ranking Sections (same as Program Sections) */
.ranking-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}
.ranking-section:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.ranking-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.ranking-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--program-color, #007bff);
    border-radius: 16px 16px 0 0;
}
.ranking-content {
    padding: 20px;
}
.program-ranking-subsection {
    margin-bottom: 24px;
}
.program-ranking-subsection:last-child {
    margin-bottom: 0;
}
.ranking-subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Rankings List (same as Articles List) */
.public-rankings-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Program Sections */
.program-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.program-section:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.program-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.program-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--program-color, #007bff);
    border-radius: 16px 16px 0 0;
}

.program-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.program-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--program-color, #007bff), color-mix(in srgb, var(--program-color, #007bff) 70%, #000));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.program-hashtag {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 10px;
    border-radius: 12px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.program-stats .article-count {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(var(--program-color-rgb, 0, 123, 255), 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Episode Links */
.program-episode-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.episode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.episode-btn-youtube {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.episode-btn-youtube:hover {
    background: linear-gradient(135deg, #cc0000, #990000);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.episode-btn-podcast {
    background: linear-gradient(135deg, #1db954, #1aa34a);
    color: white;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.2);
}

.episode-btn-podcast:hover {
    background: linear-gradient(135deg, #1aa34a, #158a3c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.episode-btn-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.no-episodes {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

/* Program Articles */
.program-articles {
    padding: 16px 20px;
    display: grid;
    gap: 12px;
}

.public-article-card {
    background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.public-article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.public-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: rgba(var(--program-color-rgb, 0, 123, 255), 0.3);
}

.public-article-card:hover::before {
    opacity: 1;
}

.public-article-card .article-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.public-article-card .article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    gap: 12px;
}

.public-article-card .meta-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.public-article-card .article-source {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.public-article-card .article-date {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.public-article-card .article-status {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1.5px solid currentColor;
}

.public-article-card .article-status.status-assigned {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-color: #0c5460;
}

.public-article-card .article-status.status-used {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #155724;
}

.public-article-card .article-link {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.public-article-card .article-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.public-article-card .article-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.public-article-card .article-link:hover::before {
    left: 100%;
}

/* No Articles State */
.no-articles {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-articles h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.no-articles p {
    font-size: 1rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.error-state h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.error-state p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #666;
}

/* Social Media Platform Selection */
.platform-selection {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.selection-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.platform-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.platform-checkbox {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.platform-checkbox:hover {
    border-color: #007bff;
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.platform-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    margin-right: 12px;
    accent-color: #007bff;
    cursor: pointer;
    transform: scale(1.2);
}

.platform-checkbox input[type="checkbox"]:checked + .platform-name {
    font-weight: 600;
    color: #007bff;
}

.platform-checkbox:has(input:checked) {
    border-color: #007bff;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.platform-name {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.platform-name::before {
    content: "";
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 6px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.platform-checkbox input[value="bluesky"] + .platform-name::before {
    background-color: #0085ff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z'/%3E%3C/svg%3E");
}

.platform-checkbox input[value="x"] + .platform-name::before {
    background-color: #000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .platform-checkbox {
        padding: 12px 15px;
    }
    
    .platform-name {
        font-size: 0.95rem;
    }
}

/* Legacy Login Screen (Hidden by default) */
.login-screen {
    display: none;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 2rem;
}

.login-form p {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border: 1px solid #ffc107;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    border-color: #d39e00;
}

/* Header */
.header {
    background: white;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    color: #007bff;
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 5px;
}

.nav-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-btn:hover {
    background: #f8f9fa;
}

.nav-btn.active {
    background: #007bff;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

#username-display {
    font-weight: 600;
    color: #333;
}

/* Main Content */
.main {
    padding: 30px 0;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-header h2 {
    font-size: 2rem;
    color: #333;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.quick-collect-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quick-collect-section h3 {
    margin: 0 0 16px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.collect-form-inline {
    margin-bottom: 12px;
}

.form-group-inline {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.form-group-inline input[type="url"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group-inline input[type="url"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group-inline .btn {
    padding: 12px 24px;
    white-space: nowrap;
    min-width: 80px;
}

.collect-status {
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 0;
    min-height: 1.5em;
}

.collect-status.info {
    color: #0c5aa6;
}

.collect-status.success {
    color: #155724;
    font-weight: 500;
}

.collect-status.error {
    color: #721c24;
    font-weight: 500;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
}

.dashboard-content {
    display: block;
    width: 100%;
}

.recent-articles {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.recent-articles h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.actions-grid {
    display: grid;
    gap: 10px;
}

.action-btn {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-weight: 500;
}

.action-btn:hover {
    border-color: #007bff;
    background: #e7f3ff;
}

/* Articles */
.articles-filters {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.archive-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
}

.archive-toggle input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

.articles-list {
    display: grid;
    gap: 15px;
}

.article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.article-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.article-source {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.article-date {
    font-size: 0.8rem;
}

.article-body {
    padding: 20px;
}

.article-summary {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.article-url {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.article-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    display: inline-block;
}

.article-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.article-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.article-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-assigned {
    background: #d4edda;
    color: #155724;
}

.status-used {
    background: #cce5ff;
    color: #004085;
}

.status-archived {
    background: #f8d7da;
    color: #721c24;
}

/* Programs */
.programs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.program-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.program-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.program-header {
    padding: 25px;
}

.program-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.program-hashtag {
    color: #666;
    font-size: 0.9rem;
}

.program-stats {
    padding: 20px 25px;
    background: #f8f9fa;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.program-stat {
    font-size: 0.9rem;
}

.program-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.program-actions {
    padding: 20px 25px;
    display: flex;
    gap: 10px;
}

.episode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px; /* vertical gap, horizontal gap */
    align-items: center;
    justify-content: flex-end;
    margin-top: 15px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .episode-actions {
        justify-content: flex-start;
        gap: 10px 8px;
    }
}

/* Recording */
.recording-setup {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.recording-session {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.recording-header {
    background: #28a745;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recording-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.available-articles,
.selected-articles {
    min-height: 400px;
}

.available-articles h4,
.selected-articles h4 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Recording Articles */
.recording-article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.recording-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.recording-article-card.selected {
    border-left: 5px solid #28a745;
}

.recording-article-card .article-order {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #28a745;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.recording-article-card h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
    padding-right: 40px;
}

.recording-article-card .article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.recording-article-card .article-source {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.recording-article-card .article-date {
    font-size: 0.8rem;
}

.recording-article-card .article-url {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.recording-article-card .article-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    display: inline-block;
}

.recording-article-card .article-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.recording-article-card .article-summary {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.recording-article-card .article-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Show Notes Generator */
.show-notes-generator {
    max-width: 600px;
}

.show-notes-intro {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.show-notes-intro p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

.options-section {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.option-item {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0 12px 0 0;
    transform: scale(1.2);
    cursor: pointer;
}

.option-description {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    margin-left: 32px;
}

.format-buttons {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.format-copy-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    min-height: 80px;
}

.format-copy-btn:hover {
    border-color: #007bff;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.15);
}

.format-copy-btn:active {
    transform: translateY(0);
}

.format-copy-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.markdown-btn:hover {
    border-color: #28a745;
    background: #f8fff8;
}

.html-btn:hover {
    border-color: #fd7e14;
    background: #fffaf8;
}

.text-btn:hover {
    border-color: #6c757d;
    background: #f8f9fa;
}

.btn-icon {
    font-size: 2rem;
    margin-right: 20px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-content {
    flex: 1;
}

.btn-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.btn-content p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 0.9rem;
}

.copy-hint {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.preview-section {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header h5 {
    margin: 0;
    color: #333;
    font-size: 1rem;
}

.preview-header select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.9rem;
}

.preview-content {
    position: relative;
}

#preview-textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background: #fafafa;
    color: #333;
    resize: vertical;
}

/* Episodes */
.episodes-list {
    display: grid;
    gap: 15px;
}

.episode-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.episode-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.episode-title {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.episode-meta {
    font-size: 0.9rem;
    color: #666;
}

.episode-youtube {
    background: #ff0000;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-right: 5px;
}

.episode-podcast {
    background: #9146ff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
}

/* Episode Articles Management */
.episode-articles-management {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.episode-articles-management h5 {
    margin-bottom: 15px;
    color: #333;
}

.current-articles-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

.article-item-edit {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s ease;
}

.article-item-edit:hover {
    background: #e9ecef;
}

.article-item-edit[draggable="true"]:active {
    opacity: 0.5;
}

.article-order-number {
    width: 30px;
    height: 30px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.article-details {
    flex: 1;
    min-width: 0;
}

.article-details h6 {
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-details .article-source {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.article-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.move-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.move-buttons .btn {
    min-width: 30px;
    height: 24px;
    padding: 2px 6px;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.move-buttons .btn:disabled {
    opacity: 0.3;
}

.add-article-section {
    text-align: center;
}

/* Add Article Modal Styles */
.add-article-form {
    max-height: 60vh;
}

.available-articles-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
}

.article-item-select {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.article-item-select:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.article-checkbox {
    margin-right: 15px;
    padding-top: 2px;
}

.article-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

.article-item-select .article-details {
    flex: 1;
}

.article-item-select .article-details h6 {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    line-height: 1.4;
    margin-bottom: 8px;
}

.article-summary {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
    margin-top: 8px !important;
}

/* Settings */
.settings-content {
    display: grid;
    gap: 30px;
}

/* Bookmarklet */
.bookmarklet-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bookmarklet-info {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.bookmarklet-info small {
    font-size: 0.9em;
    line-height: 1.4;
}

.bookmarklet-result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.bookmarklet-result textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
}

.setup-instructions {
    margin-top: 20px;
}

.setup-instructions h4 {
    color: #495057;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setup-instructions ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.setup-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.setup-instructions code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.usage-info {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.usage-info h5 {
    color: #007bff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-info p {
    margin: 0;
    color: #6c757d;
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: #6c757d;
    color: white;
}

.settings-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Batch Collect Modal */
.batch-collect-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.batch-collect-form p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.batch-collect-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 200px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.batch-collect-form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.batch-collect-form textarea::placeholder {
    color: #999;
    font-style: italic;
}

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #ffc107;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Messages View Styles */
.messages-filters {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.messages-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.message-item {
    border-bottom: 1px solid #eee;
    padding: 20px;
    transition: background-color 0.2s;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.message-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 統一されたメッセージ情報タグスタイル */
.message-id,
.message-status,
.message-source,
.message-program,
.championship-points,
.bonus-points {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    min-width: 50px;
}

.message-id {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.message-status {
    text-transform: uppercase;
}

.status-received {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-read {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.status-adopted {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.status-rejected {
    background-color: #ffebee;
    color: #c62828;
}

.message-source {
    background-color: #f5f5f5;
    color: #666;
}

.message-program {
    background-color: #e1f5fe;
    color: #0277bd;
}

.championship-points {
    background-color: #fff3e0;
    color: #e65100;
}

.bonus-points {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.listener-name {
    font-weight: 500;
    color: #333;
}

.unassigned {
    color: #f44336;
    font-style: italic;
}

.received-date {
    color: #999;
}

.message-content {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #333;
    padding: 12px 16px;
    background-color: #fafafa;
    border-radius: 6px;
    background-image: repeating-linear-gradient(
        transparent,
        transparent calc(1.8em - 1px),
        #e8e8e8 calc(1.8em - 1px),
        #e8e8e8 1.8em
    );
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'BIZ UDPGothic', 'Meiryo', sans-serif;
}

.message-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* Episode Selector */
.episode-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.quick-episodes {
    display: flex;
    gap: 4px;
}

.episode-quick {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 32px;
    border-radius: 4px;
    border: 1px solid #007bff;
    background: transparent;
    color: #007bff;
    cursor: pointer;
    transition: all 0.2s;
}

.episode-quick:hover {
    background: #007bff;
    color: white;
}


.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.listener-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.listener-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.listener-stats {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.listener-memo {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Modal for Messages */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.modal-close:hover {
    background-color: #f5f5f5;
}

.modal-body {
    padding: 20px;
}

/* Message Detail Styles */
.message-details {
    max-height: 60vh;
    overflow-y: auto;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

.detail-row label {
    font-weight: bold;
    min-width: 120px;
    margin-right: 15px;
    color: #666;
}

.message-content-full {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Listener Management Styles */
.listener-management {
    max-height: 70vh;
    overflow-y: auto;
}

.listener-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.listener-management-header .form-group {
    flex: 1;
    margin-right: 15px;
    margin-bottom: 0;
}

.listener-management-list {
    max-height: 50vh;
    overflow-y: auto;
}

.listener-management-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fafafa;
}

.listener-info {
    flex: 1;
}

.listener-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.listener-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.listener-memo {
    font-size: 13px;
    color: #777;
    font-style: italic;
    margin-bottom: 10px;
}

.listener-identities {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.identity-tag {
    background: #e1f5fe;
    color: #0277bd;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
}

.listener-actions {
    display: flex;
    gap: 5px;
    flex-direction: column;
}

.identity-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.identity-input select,
.identity-input input {
    flex: 1;
}

.current-listener {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
}

.listener-actions {
    display: flex;
    gap: 8px;
}

/* Listener editing styles */
.identity-input {
    margin-bottom: 10px;
}

.identity-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.identity-platform {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.identity-value {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.remove-identity {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.listener-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
    font-size: 14px;
}

.stats-row:last-child {
    margin-bottom: 0;
}

.stats-row span {
    color: #6c757d;
}

/* Form actions styling for listener edit */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-actions .btn-danger {
    margin-right: auto; /* Push delete button to the left */
}

/* Import dialog styles */
.import-dialog {
    width: 100%;
    max-width: 800px;
}

.import-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.import-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.import-tab:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.import-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #fff;
}

.import-content {
    display: none;
}

.import-content.active {
    display: block;
}

.format-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.format-info p {
    margin: 8px 0;
    color: #495057;
}

.format-info code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.format-info pre {
    background: #e9ecef;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

.format-example {
    font-style: italic;
    color: #6c757d;
}

.import-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.import-preview h4 {
    color: #495057;
    margin-bottom: 15px;
}

.preview-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
}

.preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f4;
}

.preview-table tr:hover {
    background-color: #f8f9fa;
}

.content-cell {
    max-width: 200px;
    word-break: break-word;
}

.preview-note {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

@media (max-width: 768px) {
    .listener-management-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .listener-management-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .listener-actions {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .identity-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .identity-platform {
        min-width: auto;
        width: 100%;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 8px;
    }
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Public View Mobile */
    .public-header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .login-fields {
        justify-content: center;
        width: 100%;
    }
    
    .login-fields input {
        flex: 1;
        min-width: 100px;
    }
    
    .program-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .program-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .public-article-card .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Admin View Mobile */
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-content {
        display: block;
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .articles-filters {
        grid-template-columns: 1fr;
    }
    
    .recording-content {
        grid-template-columns: 1fr;
    }
    
    .programs-list {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
}

/* Print Styles */
@media print {
    .header,
    .modal-overlay,
    .toast-container {
        display: none;
    }
    
    .main {
        padding: 0;
    }
    
    .article-actions,
    .program-actions {
        display: none;
    }
}

/* Recording Pause/Resume Styles */
.episode-card.episode-paused {
    border-left: 4px solid #ffc107;
    background: #fff9e6;
}

.episode-status-paused {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

/* Social Post Preview Styles */
.social-post-preview {
    max-width: 500px;
    margin: 0 auto;
}

.platform-info {
    text-align: center;
    margin-bottom: 20px;
    color: #007bff;
}

.platform-info h5 {
    margin: 0;
    font-size: 1.1em;
}

.post-preview {
    margin-bottom: 20px;
}

.preview-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}

.preview-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.mock-post {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mock-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.mock-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    margin-right: 10px;
}

.mock-user {
    display: flex;
    flex-direction: column;
}

.mock-username {
    font-weight: 600;
    font-size: 0.9em;
    color: #212529;
}

.mock-timestamp {
    font-size: 0.8em;
    color: #6c757d;
}

.mock-post-text {
    color: #212529;
    line-height: 1.4;
    white-space: pre-wrap;
}

.character-count {
    text-align: right;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #6c757d;
}

.character-count .count {
    font-weight: 600;
}

.post-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
}

.post-warning p {
    margin: 0;
    color: #856404;
    font-size: 0.9em;
}

/* Modal adjustments for social preview */
.modal .btn-primary {
    min-width: 120px;
}