/**
 * Bulletin Board - CRT Terminal Aesthetic
 *
 * Retro CRT monitor styling for announcements
 */

/* ============================================
   CRT Monitor Frame
   ============================================ */

.awc-crt-monitor {
    --crt-green: #00ff00;
    --crt-green-dim: #00aa00;
    --crt-green-glow: rgba(0, 255, 0, 0.3);
    --crt-amber: #ffb000;
    --crt-red: #ff3333;
    --crt-bg: #0a0a0a;
    --crt-bezel: #1a1a1a;
    --crt-border: #2a2a2a;

    font-family: 'VT323', 'Courier New', Courier, monospace;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.awc-crt-bezel {
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #0d0d0d 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow:
        0 0 0 3px #0a0a0a,
        0 0 0 6px #333,
        0 10px 40px rgba(0, 0, 0, 0.8),
        inset 0 2px 10px rgba(255, 255, 255, 0.05);
}

.awc-crt-screen {
    background: var(--crt-bg);
    border-radius: 15px 15px 20px 20px;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 0 100px rgba(0, 0, 0, 0.9),
        inset 0 0 20px rgba(0, 255, 0, 0.05);
}

/* Scanlines effect */
.awc-crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

/* Screen curvature effect */
.awc-crt-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 80%,
        rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
    z-index: 5;
    border-radius: inherit;
}

/* Screen flicker - disabled */
.awc-crt-screen::after {
    display: none;
}

@keyframes flicker {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.awc-crt-content {
    position: relative;
    z-index: 1;
    padding: 30px;
    min-height: 400px;
}

/* ============================================
   Bulletin Board Content
   ============================================ */

.awc-bulletin-board {
    color: var(--crt-green);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Keep links selectable/clickable */
.awc-bulletin-board a {
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.awc-bulletin-title {
    font-size: 1.8rem;
    font-weight: normal;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px var(--crt-green-glow);
}

.awc-bulletin-subtitle {
    font-size: 0.85rem;
    color: var(--crt-green-dim);
    margin: 0;
    letter-spacing: 1px;
}

.awc-cursor {
    color: var(--crt-green);
}

.awc-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   Bulletin Entries
   ============================================ */

.awc-bulletin-entries {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.awc-bulletin-entry {
    background: rgba(0, 255, 0, 0.02);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-left: 3px solid var(--crt-green);
    padding: 15px 20px;
    transition: all 0.2s ease;
}

.awc-bulletin-entry:hover {
    background: rgba(0, 255, 0, 0.05);
    border-color: var(--crt-green);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

/* Entry type colors */
.awc-bulletin-entry.type-urgent {
    border-left-color: var(--crt-red);
}

.awc-bulletin-entry.type-urgent .awc-entry-type {
    background: var(--crt-red);
}

.awc-bulletin-entry.type-release {
    border-left-color: var(--crt-amber);
}

.awc-bulletin-entry.type-release .awc-entry-type {
    background: var(--crt-amber);
}

.awc-bulletin-entry.type-event {
    border-left-color: #00ffff;
}

.awc-bulletin-entry.type-event .awc-entry-type {
    background: #00ffff;
}

.awc-entry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.awc-entry-date {
    color: var(--crt-green-dim);
    font-family: 'Courier New', monospace;
}

.awc-entry-type {
    background: var(--crt-green);
    color: #000;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.awc-entry-title {
    font-size: 1.2rem;
    font-weight: normal;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.awc-entry-title a {
    color: var(--crt-green);
    text-decoration: none;
    transition: text-shadow 0.2s ease;
}

.awc-entry-title a:hover {
    text-shadow: 0 0 15px var(--crt-green-glow);
}

.awc-entry-excerpt {
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.awc-entry-footer {
    margin-top: 10px;
}

.awc-read-more {
    color: var(--crt-green-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.awc-read-more:hover {
    color: var(--crt-green);
    text-shadow: 0 0 10px var(--crt-green-glow);
}

/* ============================================
   Single Entry View
   ============================================ */

.awc-bulletin-single .awc-back-link {
    color: var(--crt-green-dim);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 15px;
    transition: color 0.2s ease;
}

.awc-bulletin-single .awc-back-link:hover {
    color: var(--crt-green);
}

.awc-bulletin-full {
    border: none;
    background: transparent;
    padding: 0;
}

.awc-bulletin-full .awc-entry-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.awc-bulletin-full .awc-entry-image {
    margin: 20px 0;
    border: 2px solid var(--crt-green-dim);
}

.awc-bulletin-full .awc-entry-image img {
    display: block;
    width: 100%;
    height: auto;
    filter: contrast(1.1) brightness(0.9);
}

.awc-bulletin-full .awc-entry-content {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.7;
}

.awc-bulletin-full .awc-entry-content p {
    margin-bottom: 1em;
}

.awc-bulletin-full .awc-entry-content a {
    color: var(--crt-green);
}

.awc-bulletin-full .awc-entry-meta {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--crt-green-dim);
    text-align: center;
}

.awc-transmission-end {
    color: var(--crt-green-dim);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* ============================================
   Footer & Status
   ============================================ */

.awc-bulletin-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--crt-green-dim);
    font-size: 0.8rem;
    color: var(--crt-green-dim);
}

.awc-status-light {
    width: 8px;
    height: 8px;
    background: var(--crt-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--crt-green);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.awc-timestamp {
    margin-left: auto;
    font-family: 'Courier New', monospace;
}

/* ============================================
   Empty State
   ============================================ */

.awc-bulletin-empty {
    text-align: center;
    padding: 60px 20px;
}

.awc-bulletin-empty p {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.awc-dim {
    color: var(--crt-green-dim);
    font-size: 0.9rem !important;
}

/* ============================================
   Navigation
   ============================================ */

.awc-bulletin-nav {
    text-align: center;
    margin-top: 25px;
}

.awc-view-all {
    color: var(--crt-green);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 20px;
    border: 1px solid var(--crt-green);
    transition: all 0.2s ease;
}

.awc-view-all:hover {
    background: var(--crt-green);
    color: #000;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .awc-crt-bezel {
        padding: 15px;
        border-radius: 15px;
    }

    .awc-crt-content {
        padding: 20px;
    }

    .awc-bulletin-title {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }

    .awc-entry-header {
        flex-wrap: wrap;
    }

    .awc-bulletin-footer {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .awc-timestamp {
        margin-left: 0;
        width: 100%;
        margin-top: 5px;
    }
}

/* ============================================
   Moments Row (Instagram Stories Style)
   ============================================ */

.awc-bulletin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--crt-green-dim);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.awc-bulletin-header-left {
    flex: 1;
    min-width: 0;
}

.awc-moments-row {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.awc-moments-label {
    font-size: 0.65rem;
    color: var(--crt-green-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.awc-moments-items {
    display: flex;
    align-items: center;
    gap: 10px;
}

.awc-moment-thumb {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.awc-moment-thumb:hover {
    transform: scale(1.1);
}

.awc-moment-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--crt-green), #00ffaa, var(--crt-green));
    animation: ring-glow 2s ease-in-out infinite;
}

@keyframes ring-glow {
    0%, 100% {
        box-shadow: 0 0 8px var(--crt-green-glow);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 15px var(--crt-green), 0 0 25px var(--crt-green-glow);
        opacity: 0.8;
    }
}

.awc-moment-image {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--crt-bg);
}

.awc-moment-video-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    z-index: 2;
}

.awc-moments-view-all {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px dashed var(--crt-green-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crt-green-dim);
    text-decoration: none;
    transition: all 0.2s ease;
}

.awc-moments-view-all:hover {
    border-color: var(--crt-green);
    color: var(--crt-green);
    box-shadow: 0 0 10px var(--crt-green-glow);
}

.awc-view-all-icon {
    font-size: 1.2rem;
}

/* Responsive Moments */
@media (max-width: 768px) {
    .awc-bulletin-header {
        flex-direction: column;
        align-items: stretch;
    }

    .awc-moments-row {
        align-items: flex-start;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px dashed var(--crt-green-dim);
    }

    .awc-moment-thumb,
    .awc-moments-view-all {
        width: 48px;
        height: 48px;
    }

    .awc-moments-items {
        gap: 8px;
        overflow-x: auto;
        max-width: 100%;
        padding-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .awc-moment-thumb,
    .awc-moments-view-all {
        width: 46px;
        height: 46px;
    }

    .awc-moments-items {
        gap: 6px;
    }
}

/* ============================================
   Moments "+More" Button
   ============================================ */

.awc-moments-more {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--crt-green-dim);
    background: rgba(0, 255, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.awc-moments-more:hover {
    border-color: var(--crt-green);
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px var(--crt-green-glow);
}

.awc-more-count {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--crt-green);
    font-family: 'VT323', monospace;
}

/* Button reset for moment thumbs */
button.awc-moment-thumb {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
}

/* ============================================
   Moments Modal
   ============================================ */

.awc-moments-modal {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    isolation: isolate;
}

.admin-bar .awc-moments-modal {
    top: 89px;
}

@media (max-width: 782px) {
    .admin-bar .awc-moments-modal {
        top: 103px;
    }
}

/* Hide CRT effects when modal is open (prevents double scanlines) */
body:has(.awc-moments-modal:not([aria-hidden="true"])) .awc-crt-screen::before,
body:has(.awc-moments-modal:not([aria-hidden="true"])) .awc-crt-screen::after,
body:has(.awc-moments-modal:not([aria-hidden="true"])) .awc-crt-scanlines {
    display: none !important;
}

.awc-moments-modal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.awc-moments-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.awc-moments-modal-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 100%;
    max-height: 680px;
    display: flex;
    flex-direction: column;
}

/* Close button - on the modal, small and translucent */
.awc-moments-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(0, 255, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    color: rgba(0, 255, 0, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.awc-moments-modal-close:hover {
    background: rgba(0, 255, 0, 0.2);
    border-color: var(--crt-green, #00ff00);
    color: var(--crt-green, #00ff00);
}

.awc-moments-modal-close .close-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.awc-moments-modal-close .close-text {
    display: none;
}

.awc-moments-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Scanlines overlay for modal */
.awc-moments-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 50;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

/* Progress bars */
.awc-moments-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
    z-index: 10;
}

.awc-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.awc-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--crt-green, #00ff00);
    border-radius: 2px;
}

.awc-progress-bar.completed span {
    width: 100% !important;
    transition: none !important;
}

.awc-progress-bar.active span {
    background: #fff;
}

/* Media container */
.awc-moments-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
}

.awc-moments-media img,
.awc-moments-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Info overlay */
.awc-moments-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
}

.awc-moment-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.awc-moment-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Navigation zones - full height click areas on left/right 15% */
.awc-moments-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.awc-moments-modal-content:hover .awc-moments-nav {
    opacity: 1;
}

.awc-moments-prev {
    left: 0;
}

.awc-moments-next {
    right: 0;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .awc-moments-modal {
        padding: 12px;
    }

    .awc-moments-modal-container {
        max-width: 100%;
        max-height: none;
    }

    .awc-moments-modal-content {
        border-radius: 10px;
    }

    .awc-moments-modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        opacity: 1;
        background: rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(0, 255, 0, 0.4);
    }

    .awc-moments-nav {
        opacity: 0.5;
    }

    .awc-moments-more {
        width: 40px;
        height: 40px;
    }

    .awc-more-count {
        font-size: 0.7rem;
    }
}

/* ============================================
   Google Font Import (optional)
   ============================================ */

/* ============================================
   Newest Moment — Radar Pulse
   ============================================ */
.awc-moment-newest .awc-moment-ring {
    animation: awc-newest-radar 1.5s ease-in-out infinite;
}

@keyframes awc-newest-radar {
    0%, 100% {
        box-shadow: 0 0 8px var(--crt-green-glow), 0 0 16px var(--crt-green-glow);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 12px var(--crt-green), 0 0 28px var(--crt-green-glow), 0 0 40px rgba(0, 255, 136, 0.15);
        opacity: 0.85;
    }
}

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
