:root {
    --rf-red: #ed1c24;
    --rf-bg: #fff;
    --rf-text: #111;
    --rf-muted: #666;
    --rf-border: #ececec;
}

/* Container */
.rifnote-livefeed-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--rf-bg);
    color: var(--rf-text);
}

@media (max-width: 600px) {
    .rifnote-livefeed-page {
        padding: 16px;
    }
}

/* Header */
.rifnote-livefeed-header {
    margin-bottom: 24px;
}

.rifnote-livefeed-header__title {
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 12px 0;
}

.rifnote-livefeed-header__meta {
    font-size: 14px;
    color: var(--rf-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.rifnote-livefeed-header__meta span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.rifnote-livefeed-header__meta span:not(:last-child)::after {
    content: "";
    display: block;
    width: 1px;
    height: 12px;
    background-color: #ccc;
    margin: 0 12px;
}

.rifnote-livefeed-header__status {
    font-weight: 700;
    color: var(--rf-red);
    text-transform: uppercase;
    font-size: 13px;
}

.rifnote-livefeed-header__comp {
    font-weight: 600;
    color: var(--rf-text);
}

/* Live Indicator */
.rifnote-live-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #ed1c24;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    vertical-align: middle;
    top: -3px;
    z-index: 0;
}

.rifnote-live-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ed1c24;
    border-radius: 50%;
    animation: rifnote-pulse-ring 1.5s infinite;
    z-index: -1;
}

@keyframes rifnote-pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Controls */
.rifnote-livefeed-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.rifnote-livefeed-controls__label {
    font-weight: 700;
    font-size: 14px;
}

.rifnote-livefeed-controls__select {
    border: 1px solid #cfcfcf;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 0;
}

/* Item */
.rifnote-livefeed-item {
    border: 1px solid var(--rf-border);
    margin-bottom: 20px;
    position: relative;
    background: #fff;
}

.rifnote-livefeed-item__toprule {
    height: 3px;
    background-color: var(--rf-red);
    width: 100%;
}

/* Time Pill */
.rifnote-livefeed-item__timestamp {
    margin: 12px 16px 10px;
}

.rifnote-livefeed-item__timepill {
    background-color: var(--rf-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 3px;
    display: inline-block;
}

/* Title */
.rifnote-livefeed-item__title {
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 16px 6px;
    color: var(--rf-text);
}

/* Subline */
.rifnote-livefeed-item__subline {
    color: var(--rf-muted);
    font-size: 14px;
    margin: 0 16px 12px;
}

/* Body */
.rifnote-livefeed-item__body {
    font-size: 17px;
    line-height: 1.65;
    margin: 0 16px 10px;
    color: var(--rf-text);
}

.rifnote-livefeed-item__body p {
    margin-bottom: 14px;
}

.rifnote-livefeed-item__body p:last-child {
    margin-bottom: 0;
}

/* Media */
.rifnote-livefeed-item__media {
    margin: 12px 16px 0;
    position: relative;
}

.rifnote-livefeed-item__media-wrap {
    position: relative;
}

.rifnote-livefeed-item__img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.rifnote-livefeed-item__media-source {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 4px;
}

/* Footer */
.rifnote-livefeed-item__footer {
    border-top: 1px solid var(--rf-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 14px;
    margin-top: 16px;
}

.rifnote-livefeed-item__reactions {
    display: inline-flex;
    gap: 12px;
}

.rifnote-livefeed-action {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--rf-text);
    padding: 0;
    font-size: 14px;
}

.rifnote-livefeed-action:hover {
    color: var(--rf-red);
}

.rifnote-livefeed-action.is-liked {
    color: var(--rf-red);
}

.rifnote-livefeed-action.is-active {
    color: var(--rf-red);
}

.rifnote-livefeed-item__share-wrapper {
    position: relative;
}

.rifnote-livefeed-item__share-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--rf-text);
    padding: 0;
    font-size: 14px;
}

.rifnote-livefeed-item__share-toggle:hover {
    color: var(--rf-red);
}

.rifnote-livefeed-item__share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--rf-border);
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    gap: 8px;
    z-index: 10;
    white-space: nowrap;
}

.rifnote-livefeed-item__share-menu.is-open {
    display: flex;
}

.rifnote-share-link {
    color: var(--rf-text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.rifnote-share-link:hover {
    color: var(--rf-red);
}

/* Comments Section */
.rifnote-livefeed-item__comments {
    border-top: 1px solid var(--rf-border);
    background: #f9f9f9;
    padding: 16px;
    font-size: 14px;
}

.rifnote-comments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.rifnote-comments-list li {
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.rifnote-comments-list li:last-child {
    border-bottom: none;
}

.rifnote-no-comments {
    color: var(--rf-muted);
    font-style: italic;
    margin-bottom: 16px;
}

/* Comment Form overrides */
.rifnote-livefeed-item__comments .comment-form-comment label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}
.rifnote-livefeed-item__comments textarea {
    width: 100%;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
}

/* Feeds Grid Shortcode */
.riffy-feeds-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.riffy-feed-featured {
    background: #fff;
    border: 1px solid var(--rf-border);
    padding: 24px;
    margin-bottom: 24px;
    border-left: 4px solid var(--rf-red);
}

.riffy-feed-title {
    margin: 0 0 16px 0;
    font-size: 24px;
    line-height: 1.2;
}

.riffy-feed-title a {
    text-decoration: none;
    color: var(--rf-text);
}

.riffy-feed-updates {
    list-style: none;
    padding: 0;
    margin: 0;
}

.riffy-feed-updates li {
    margin-bottom: 8px;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.riffy-update-time {
    font-weight: bold;
    color: var(--rf-red);
    margin-right: 8px;
}

.riffy-feed-subgrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .riffy-feed-subgrid {
        grid-template-columns: 1fr 1fr;
    }
}

.riffy-feed-card {
    background: #fff;
    border: 1px solid var(--rf-border);
    padding: 20px;
}

.riffy-feed-card .riffy-feed-title {
    font-size: 18px;
    margin-bottom: 0;
}

.riffy-feeds-footer {
    text-align: center;
    margin-top: 24px;
}

.riffy-view-all-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: background 0.2s;
}

.riffy-view-all-btn:hover {
    background: #333;
    color: #fff;
}

/* Live Button Shortcode */
.rifnote-live-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #111;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.rifnote-live-button:hover {
    background-color: #333;
}

/* Pinned */
.rifnote-livefeed-item.is-pinned {
    background: #f9fafb;
    border-left: 4px solid var(--rf-red);
}

/* Fallback Embed */
.rifnote-livefeed-embed-fallback {
    display: inline-block;
    border: 1px solid var(--rf-border);
    padding: 10px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--rf-text);
    font-weight: 600;
}

.rifnote-livefeed-embed-fallback:hover {
    border-color: var(--rf-red);
    color: var(--rf-red);
}

/* Pagination */
.rifnote-livefeed__pagination {
    margin-top: 24px;
    text-align: center;
}

.rifnote-load-more {
    background: var(--rf-text);
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
}

/* Update Bar */
.rifnote-update-bar {
    background: var(--rf-red);
    color: #fff;
    text-align: center;
    padding: 12px;
    margin-bottom: 24px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}
.rifnote-update-bar:hover {
    background: #c0151c;
}

/* Action Headers */
.rifnote-livefeed-item__action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    line-height: 1;
}

.rifnote-livefeed-item__action-header svg {
    display: block;
}

.rifnote-icon--goal { color: #00823b; }
.rifnote-icon--penalty { color: #00823b; }
.rifnote-icon--red-card { color: #d0021b; }
.rifnote-icon--yellow-card { color: #f5a623; }
.rifnote-icon--substitution { color: #1d4ed8; }
.rifnote-icon--var { color: #6b7280; }
.rifnote-icon--injury { color: #d0021b; }

/* Admin Panel */
.rifnote-admin-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.rifnote-admin-toggle:hover {
    background: #333;
}
.rifnote-admin-panel {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 300px;
    background: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 14px;
}
.rifnote-form-group {
    margin-bottom: 12px;
}
.rifnote-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
}
.rifnote-form-group input,
.rifnote-form-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.rifnote-admin-save {
    background: var(--rf-red);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.rifnote-admin-close {
    background: #eee;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Create Update Modal */
.rifnote-create-toggle {
    position: fixed;
    bottom: 20px;
    right: 80px; /* Next to manage button if exists */
    z-index: 9999;
    background: var(--rf-red);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.rifnote-create-toggle:hover {
    background: #c0151c;
    transform: scale(1.05);
}
.rifnote-create-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rifnote-create-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.rifnote-create-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.rifnote-create-header h4 { margin: 0; }
.rifnote-create-close {
    background: none; border: none; font-size: 24px; cursor: pointer;
}
.rifnote-create-submit {
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}
.rifnote-create-submit:hover { background: #333; }

/* Create Update Modal Steps */
.rifnote-create-step h4 {
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.rifnote-create-next,
.rifnote-create-back {
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.rifnote-create-step[data-step="2"] .rifnote-create-submit {
    float: right;
}

/* Image Uploader */
.rifnote-image-uploader {
    border: 1px solid #ddd;
    padding: 10px;
    background: #f9f9f9;
}
.rifnote-image-preview {
    margin-bottom: 10px;
    min-height: 50px;
    text-align: center;
}
.rifnote-image-preview img {
    max-width: 150px;
    height: auto;
    border: 1px solid #ddd;
}

/* WP Editor overrides */
.rifnote-create-content .wp-editor-wrap {
    border: 1px solid #ddd;
}

/* Image Source Buttons */
.rifnote-image-source-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

/* Page Layout Wrapper */
.rifnote-page-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.rifnote-page-wrapper > #primary {
    flex: 3;
    min-width: 0; /* Prevent flex overflow */
}
.rifnote-page-wrapper > :not(#primary) {
    flex: 1;
    min-width: 280px;
}
@media (max-width: 900px) {
    .rifnote-page-wrapper {
        flex-direction: column;
    }
}
