/**
 * Noticeboard Styles
 * Pixel Art aesthetic for latest notice, RGB glitch for history
 */

/* ============ FONT IMPORTS ============ */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');

/* ============ NOTICEBOARD CONTAINER ============ */
.noticeboard {
    margin: 2rem 0;
    padding: 0 1rem;
}

.noticeboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.noticeboard-header h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.noticeboard-toggle {
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--link-color);
}

/* ============ LATEST NOTICE - PIXEL ART STYLE ============ */
.notice-latest {
    position: relative;
    background: #000;
    border: 4px solid;
    border-image: linear-gradient(90deg, #ff0000, #ff8800, #ffff00, #00ff00, #0088ff, #8800ff) 1;
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.notice-latest::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px);
    pointer-events: none;
    z-index: 1;
}

.notice-latest .notice-content {
    position: relative;
    z-index: 2;
}

/* Pixel font for latest notice */
.notice-latest.font-pixel,
.notice-latest.font-pixel * {
    font-family: 'Press Start 2P', monospace;
}

/* Gothic font option */
.notice-latest.font-gothic,
.notice-latest.font-gothic * {
    font-family: 'Creepster', cursive;
}

/* Two-column layout */
.notice-latest.layout-two-column .notice-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 600px) {
    .notice-latest.layout-two-column .notice-content {
        grid-template-columns: 1fr;
    }
}

.notice-image {
    width: 100%;
    max-width: 200px;
    image-rendering: pixelated;
    border: 2px solid #fff;
}

.notice-title {
    font-size: 1.5rem;
    color: #ff0000;
    text-shadow:
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
    margin-bottom: 1rem;
    animation: title-blink 1.5s infinite;
}

@keyframes title-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* RGB Glitch title style */
.notice-title.style-glitch {
    position: relative;
    animation: glitch 2s infinite;
}

.notice-title.style-glitch::before,
.notice-title.style-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.notice-title.style-glitch::before {
    color: #0ff;
    animation: glitch-r 0.3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.notice-title.style-glitch::after {
    color: #f0f;
    animation: glitch-b 0.3s infinite;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-r {

    0%,
    100% {
        transform: translate(-2px, 0);
    }

    50% {
        transform: translate(2px, 0);
    }
}

@keyframes glitch-b {

    0%,
    100% {
        transform: translate(2px, 0);
    }

    50% {
        transform: translate(-2px, 0);
    }
}

/* Neon glow title style */
.notice-title.style-glow {
    color: #fff;
    text-shadow:
        0 0 5px #fff,
        0 0 10px #ff00de,
        0 0 20px #ff00de,
        0 0 40px #ff00de,
        0 0 80px #ff00de;
    animation: neon-pulse 2s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #ff00de, 0 0 20px #ff00de;
    }

    to {
        text-shadow: 0 0 10px #fff, 0 0 20px #ff00de, 0 0 40px #ff00de, 0 0 80px #ff00de;
    }
}

.notice-body {
    color: #ccc;
    font-size: 0.7rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.notice-footer {
    font-size: 0.6rem;
    color: #888;
    text-align: center;
    margin-top: 1.5rem;
    animation: blink-text 1s step-end infinite;
}

@keyframes blink-text {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============ HISTORY NOTICES - RGB GLITCH MINI ============ */
.notices-history {
    margin-top: 1rem;
}

.notices-history-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.notices-history-header:hover {
    color: var(--link-color);
}

.notices-history-list {
    display: none;
}

.notices-history-list.expanded {
    display: block;
}

.notice-history-item {
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    border-left: 3px solid;
    border-image: linear-gradient(180deg, #f0f, #0ff) 1;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

.notice-history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 0, 255, 0.05) 0%,
            transparent 50%,
            rgba(0, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.notice-history-item:hover::before {
    opacity: 1;
}

.notice-history-item:hover {
    transform: translateX(3px);
}

.notice-history-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.notice-history-date {
    font-size: 0.7rem;
    color: #888;
}

.notice-history-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============ SCANLINE OVERLAY EFFECT ============ */
.scanlines {
    position: relative;
}

.scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.15) 1px,
            rgba(0, 0, 0, 0.15) 2px);
    pointer-events: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .notice-latest {
        padding: 1.5rem 1rem;
    }

    .notice-title {
        font-size: 1.1rem;
    }

    .notice-body {
        font-size: 0.65rem;
    }
}

/* ============ ADMIN FORM STYLES ============ */
.notice-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.notice-form .checkboxes {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.notice-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.notice-form .current-image {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.status-active {
    color: #4caf50;
}

.status-inactive {
    color: #f44336;
}

.status-featured {
    color: #ff9800;
    font-weight: bold;
}

.admin-table tr.highlight {
    background: rgba(255, 152, 0, 0.1);
}

/* ============ THEME-SPECIFIC NOTICEBOARD STYLES ============ */

/* === COLOR TIER === */

/* Maroon Theme - Gothic dark with turquoise accents */
.theme-maroon .notice-latest,
[data-theme="maroon"] .notice-latest {
    background: linear-gradient(135deg, #1a0a0a 0%, #2d1515 100%);
    border: 4px solid;
    border-image: linear-gradient(90deg, #800020, #40E0D0, #800020) 1;
}

.theme-maroon .notice-title,
[data-theme="maroon"] .notice-title {
    color: #40E0D0;
    text-shadow: 2px 2px 0 #800020, -1px -1px 0 #000;
}

.theme-maroon .notice-body,
[data-theme="maroon"] .notice-body {
    color: #e0e0e0;
}

.theme-maroon .notice-history-item,
[data-theme="maroon"] .notice-history-item {
    border-left-color: #800020;
    border-image: none;
}

.theme-maroon .notice-history-item:hover,
[data-theme="maroon"] .notice-history-item:hover {
    background: rgba(128, 0, 32, 0.2);
}

/* Green Theme - Forest ambiance */
.theme-green .notice-latest,
[data-theme="green"] .notice-latest {
    background: linear-gradient(135deg, #0d1f0d 0%, #1a3a1a 100%);
    border: 4px solid;
    border-image: linear-gradient(180deg, #228B22, #90EE90) 1;
}

.theme-green .notice-title,
[data-theme="green"] .notice-title {
    color: #90EE90;
    text-shadow: 2px 2px 0 #0d1f0d;
    animation: none;
}

.theme-green .notice-body,
[data-theme="green"] .notice-body {
    color: #d0f0d0;
}

.theme-green .notice-history-item,
[data-theme="green"] .notice-history-item {
    border-left: 3px solid #228B22;
    border-image: none;
}

.theme-green .notice-history-item:hover,
[data-theme="green"] .notice-history-item:hover {
    background: rgba(34, 139, 34, 0.15);
}

/* Purple Theme - Light elegant */
.theme-purple .notice-latest,
[data-theme="purple"] .notice-latest {
    background: linear-gradient(135deg, #fafafa 0%, #f0e6f5 100%);
    border: 4px solid #6b2c91;
    border-image: none;
}

.theme-purple .notice-title,
[data-theme="purple"] .notice-title {
    color: #6b2c91;
    text-shadow: 1px 1px 0 #d1b8de;
    animation: none;
}

.theme-purple .notice-body,
[data-theme="purple"] .notice-body {
    color: #333;
}

.theme-purple .notice-history-item,
[data-theme="purple"] .notice-history-item {
    background: rgba(107, 44, 145, 0.05);
    border-left: 3px solid #6b2c91;
    border-image: none;
}

.theme-purple .notice-history-item:hover,
[data-theme="purple"] .notice-history-item:hover {
    background: rgba(107, 44, 145, 0.12);
}

/* === STYLE TIER === */

/* Classic Theme - Traditional imageboard */
.theme-classic .notice-latest,
[data-theme="classic"] .notice-latest {
    background: #F0E0D6;
    border: 2px solid #B7C5D9;
    border-top: 4px solid #800000;
    border-image: none;
}

.theme-classic .notice-latest::before {
    background: none;
}

.theme-classic .notice-title,
[data-theme="classic"] .notice-title {
    color: #800000;
    text-shadow: none;
    font-family: 'Tahoma', 'Arial', sans-serif;
    animation: none;
}

.theme-classic .notice-body,
[data-theme="classic"] .notice-body {
    color: #000;
    font-family: 'Tahoma', 'Arial', sans-serif;
    font-size: 0.85rem;
}

.theme-classic .notice-history-item,
[data-theme="classic"] .notice-history-item {
    background: #D6DAF0;
    border-left: 3px solid #800000;
    border-image: none;
}

.theme-classic .notice-history-item:hover,
[data-theme="classic"] .notice-history-item:hover {
    background: #c6cae0;
}

/* Neo Theme - Brutalist design */
.theme-neo .notice-latest,
[data-theme="neo"] .notice-latest {
    background: #fff;
    border: 6px solid #000;
    border-image: none;
    box-shadow: 8px 8px 0 #000;
}

.theme-neo .notice-latest::before {
    background: none;
}

.theme-neo .notice-title,
[data-theme="neo"] .notice-title {
    color: #000;
    text-shadow: none;
    font-family: 'Space Grotesk', 'Arial Black', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: none;
}

.theme-neo .notice-body,
[data-theme="neo"] .notice-body {
    color: #000;
    font-size: 0.9rem;
}

.theme-neo .notice-history-item,
[data-theme="neo"] .notice-history-item {
    background: #FFFF00;
    border: 3px solid #000;
    border-image: none;
}

.theme-neo .notice-history-item:hover,
[data-theme="neo"] .notice-history-item:hover {
    background: #e6e600;
    transform: translateX(5px);
}

/* Modern Theme - Sleek minimal */
.theme-modern .notice-latest,
[data-theme="modern"] .notice-latest {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(90deg, #4cc9f0, #7209b7, #4cc9f0) 1;
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.2);
}

.theme-modern .notice-title,
[data-theme="modern"] .notice-title {
    color: #4cc9f0;
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.5);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.theme-modern .notice-body,
[data-theme="modern"] .notice-body {
    color: #f0f0f0;
}

.theme-modern .notice-history-item,
[data-theme="modern"] .notice-history-item {
    border-left: 3px solid #7209b7;
    border-image: none;
    background: rgba(26, 26, 46, 0.8);
}

.theme-modern .notice-history-item:hover,
[data-theme="modern"] .notice-history-item:hover {
    background: rgba(114, 9, 183, 0.2);
    box-shadow: 0 0 10px rgba(114, 9, 183, 0.3);
}

/* === THEMATIC TIER === */

/* Chutzpah Theme - Golden audacity */
.theme-chutzpah .notice-latest,
[data-theme="chutzpah"] .notice-latest {
    background: linear-gradient(135deg, #1a1815 0%, #2d2820 50%, #3d3830 100%);
    border: 4px solid;
    border-image: linear-gradient(135deg, #D4AF37, #FFD700, #B8860B) 1;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}

.theme-chutzpah .notice-latest::before {
    background: repeating-linear-gradient(0deg,
        transparent,
        transparent 3px,
        rgba(212, 175, 55, 0.03) 3px,
        rgba(212, 175, 55, 0.03) 6px);
}

.theme-chutzpah .notice-title,
[data-theme="chutzpah"] .notice-title {
    color: #D4AF37;
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.theme-chutzpah .notice-body,
[data-theme="chutzpah"] .notice-body {
    color: #f0e6d2;
}

.theme-chutzpah .notice-history-item,
[data-theme="chutzpah"] .notice-history-item {
    border-left: 3px solid #D4AF37;
    border-image: none;
    background: rgba(45, 40, 32, 0.8);
}

.theme-chutzpah .notice-history-item:hover,
[data-theme="chutzpah"] .notice-history-item:hover {
    background: rgba(212, 175, 55, 0.15);
    border-left-color: #FFD700;
}

/* Memento Mori Theme - Gothic death aesthetic */
.theme-memento_mori .notice-latest,
[data-theme="memento_mori"] .notice-latest {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a18 100%);
    border: 3px solid #E8DCC4;
    border-image: none;
    position: relative;
}

.theme-memento_mori .notice-latest::before {
    background: 
        repeating-linear-gradient(0deg,
            transparent,
            transparent 1px,
            rgba(232, 220, 196, 0.02) 1px,
            rgba(232, 220, 196, 0.02) 2px),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 15 L30 12 L25 15 Z' fill='%23E8DCC4' fill-opacity='0.03'/%3E%3C/svg%3E");
}

.theme-memento_mori .notice-title,
[data-theme="memento_mori"] .notice-title {
    color: #E8DCC4;
    font-family: 'EB Garamond', 'Palatino', serif;
    text-shadow: 0 0 8px rgba(232, 220, 196, 0.3);
    font-style: italic;
    letter-spacing: 0.05em;
}

.theme-memento_mori .notice-body,
[data-theme="memento_mori"] .notice-body {
    color: #d4d4c8;
    font-family: 'EB Garamond', 'Palatino', serif;
}

.theme-memento_mori .notice-footer,
[data-theme="memento_mori"] .notice-footer {
    font-style: italic;
    color: #808070;
}

.theme-memento_mori .notice-history-item,
[data-theme="memento_mori"] .notice-history-item {
    border-left: 3px solid #8B7355;
    border-image: none;
    background: rgba(26, 26, 24, 0.9);
}

.theme-memento_mori .notice-history-item:hover,
[data-theme="memento_mori"] .notice-history-item:hover {
    background: rgba(139, 115, 85, 0.15);
}

/* Zugzwang Theme - Chess monochrome */
.theme-zugzwang .notice-latest,
[data-theme="zugzwang"] .notice-latest {
    background: 
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-color: #1a1a1a;
    border: 4px solid #fff;
    border-image: none;
    box-shadow: 
        inset 0 0 0 2px #1a1a1a,
        inset 0 0 0 4px #888;
}

.theme-zugzwang .notice-latest::before {
    background: none;
}

.theme-zugzwang .notice-title,
[data-theme="zugzwang"] .notice-title {
    color: #fff;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: none;
}

.theme-zugzwang .notice-body,
[data-theme="zugzwang"] .notice-body {
    color: #eee;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

.theme-zugzwang .notice-history-item,
[data-theme="zugzwang"] .notice-history-item {
    border-left: 3px solid #fff;
    border-image: none;
    background: #2a2a2a;
}

.theme-zugzwang .notice-history-item:hover,
[data-theme="zugzwang"] .notice-history-item:hover {
    background: #3a3a3a;
    border-left-color: #888;
}

/* ============ TOGGLE FUNCTIONALITY JS HELPER ============ */
.notices-history-list.show {
    display: block;
}