/* News Dashboard - Modern Tile Design */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 40px);
}

/* Header Styles */
h1 {
    font-family: 'Courier New', monospace;
    font-size: 2.8rem;
    font-weight: bold;
    text-align: center;
    margin: 0 0 10px 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 4px;
    border-bottom: 4px double #1a1a1a;
    padding-bottom: 15px;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-style: italic;
}

/* Dashboard Controls */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 30px 0;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #1a1a1a;
    box-shadow: 4px 4px 0px #1a1a1a;
}

.admin-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-btn {
    background: #1a1a1a;
    color: #fff;
    border: 2px solid #1a1a1a;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px #666;
}

.admin-btn:hover {
    background: #333;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #666;
}

.admin-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #666;
}

.status {
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* Main Dashboard Layout */
.dashboard-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Events Section */
.events-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.events-container {
    background: #fff;
    border: 2px solid #ccc;
    box-shadow: 3px 3px 0px #ccc;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 2px solid #ccc;
    background: #f9f9f9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.events-header h3 {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.refresh-btn {
    background: #1a1a1a;
    color: #fff;
    border: 2px solid #1a1a1a;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px #666;
}

.refresh-btn:hover {
    background: #333;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #666;
}

.refresh-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #666;
}

.refresh-btn.loading {
    background: #666;
    cursor: not-allowed;
    opacity: 0.7;
    /* Override any flex/padding from .loading class */
    display: inline-block !important;
    flex-direction: initial !important;
    align-items: initial !important;
    justify-content: initial !important;
    padding: 8px 12px !important;
}

.events-source {
    padding: 10px 15px;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    font-style: italic;
}

.events-source a {
    color: #1a1a1a;
    text-decoration: underline;
    font-weight: bold;
}

.events-source a:hover {
    background: #e0e0e0;
    padding: 2px 4px;
}

.events-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Custom Scrollbar */
.events-list-container::-webkit-scrollbar {
    width: 10px;
}

.events-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border: 1px solid #ddd;
}

.events-list-container::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border: 1px solid #666;
}

.events-list-container::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* Event Tiles */
.event {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 1px 1px 0px #ddd;
}

.event:hover {
    border-color: #999;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px #999;
}

.event:last-child {
    margin-bottom: 0;
}

.event h3 {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 12px 0;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.event p {
    margin: 6px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.event strong {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #333;
}

.event a {
    color: #1a1a1a;
    text-decoration: underline;
    font-weight: bold;
}

.event a:hover {
    background: #f0f0f0;
    padding: 2px 4px;
}

/* Slack Section */
.slack-container {
    background: #fff;
    border: 2px solid #1a1a1a;
    box-shadow: 6px 6px 0px #1a1a1a;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.slack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #1a1a1a;
    background: #f9f9f9;
}

.slack-header h2 {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #1a1a1a;
}

.slack-source {
    padding: 15px 20px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
    font-style: italic;
}

/* Channel Filters */
.channel-filters {
    padding: 20px;
    border-bottom: 2px solid #ddd;
    background: #fafafa;
}

.filter-label {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

#filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.channel-filter-btn {
    background: #fff;
    color: #1a1a1a;
    border: 2px solid #ddd;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px #ddd;
}

.channel-filter-btn:hover {
    border-color: #1a1a1a;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #1a1a1a;
}

.channel-filter-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    box-shadow: 2px 2px 0px #666;
}

.channel-filter-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #ddd;
}

/* Slack Messages */
.slack-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.slack-list-container::-webkit-scrollbar {
    width: 10px;
}

.slack-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border: 1px solid #ddd;
}

.slack-list-container::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border: 1px solid #666;
}

.slack-list-container::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.slack-message {
    background: #fff;
    border: 2px solid #ddd;
    padding: 0;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0px #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.slack-message:hover {
    border-color: #1a1a1a;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px #1a1a1a;
}

.slack-message:last-child {
    margin-bottom: 0;
}

/* Message Header */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
}

.channel-badge.happenings {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.channel-badge.hackathons {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.channel-badge.ship {
    background: #e8f5e8;
    color: #388e3c;
    border: 1px solid #a5d6a7;
}

.channel-badge.announcements {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd9;
}

.channel-badge.default {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.timestamp {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Courier New', monospace;
    font-weight: normal;
}

/* Message Content */
.message-content {
    padding: 20px;
    line-height: 1.7;
}

.message-content.expandable {
    position: relative;
}

.happenings-content,
.ship-content,
.default-content {
    font-size: 0.95rem;
    line-height: 1.7;
}

.happenings-content {
    font-size: 1rem;
}

.happenings-content strong {
    color: #1976d2;
    font-weight: bold;
}

.happenings-content em {
    color: #666;
    font-style: italic;
}

.ship-content {
    font-size: 0.9rem;
}

.ship-content strong {
    color: #388e3c;
    font-weight: bold;
}

/* Message Actions */
.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f8f8;
    border-top: 1px solid #ddd;
    gap: 10px;
}

.expand-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expand-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.view-slack {
    color: #1a1a1a;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.view-slack:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* Enhanced text formatting */
.message-content strong {
    font-weight: bold;
    color: #1a1a1a;
}

.message-content em {
    font-style: italic;
    color: #666;
}

.message-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.message-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

.message-content li:before {
    content: "• ";
    color: #666;
    font-weight: bold;
    margin-right: 8px;
}

.channel-mention {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.channel-mention:hover {
    background: #bbdefb;
    color: #0d47a1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.user-mention {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.user-mention:hover {
    background: #e1bee7;
    color: #4a148c;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(123, 31, 162, 0.2);
}

.emoji {
    font-style: normal;
    font-weight: bold;
    color: #ff9800;
    font-size: 0.9em;
    padding: 0 2px;
}

.emoji::before {
    content: ":";
}

.emoji::after {
    content: ":";
}

.message-content a {
    color: #1976d2;
    text-decoration: underline;
    font-weight: bold;
}

.message-content a:hover {
    background: #e3f2fd;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Message type specific styling */
.slack-message.happenings {
    border-color: #1976d2;
}

.slack-message.hackathons {
    border-color: #f57c00;
}

.slack-message.ship {
    border-color: #388e3c;
}

.slack-message.announcements {
    border-color: #c2185b;
}

/* Legacy support for old message format */
.slack-message h4 {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slack-message p {
    margin: 8px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.slack-message .original-text {
    background: #f8f8f8;
    padding: 15px;
    border-left: 4px solid #1a1a1a;
    margin: 15px 0;
    font-style: italic;
    line-height: 1.6;
}

.slack-message .original-text a {
    color: #1a1a1a;
    text-decoration: underline;
    font-weight: bold;
}

.slack-message .original-text a:hover {
    background: #e0e0e0;
    padding: 2px 4px;
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

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

.loading-text {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

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

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Small loading indicator for incremental loading */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin: 10px 0;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.loading-text-small {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-event {
    border: 2px solid #eee;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-line.title {
    height: 20px;
    width: 70%;
    margin-bottom: 16px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 60%;
}

.skeleton-line.long {
    width: 80%;
}

.skeleton-message {
    border: 2px solid #eee;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}



/* Focus and Accessibility */
button:focus,
.channel-filter-btn:focus,
.refresh-btn:focus,
.admin-btn:focus {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

a:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Error States */
.error {
    color: #d32f2f;
    background: #ffebee;
    border: 2px solid #d32f2f;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .events-wrapper {
        order: 2;
    }
    
    .slack-container {
        order: 1;
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .events-container,
    .slack-container {
        box-shadow: 4px 4px 0px #1a1a1a;
    }
    
    .events-header,
    .slack-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    #filter-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .events-header h2,
    .slack-header h2 {
        font-size: 1.2rem;
    }
    
    .event,
    .slack-message {
        padding: 15px;
    }
    
    .events-list-container,
    .slack-list-container {
        padding: 15px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .event,
    .slack-message {
        border-width: 3px;
    }
    
    .events-container,
    .slack-container {
        border-width: 3px;
        box-shadow: 8px 8px 0px #1a1a1a;
    }
}

/* Footer */
.footer {
    margin-top: 40px;
    border-top: 2px solid #1a1a1a;
    padding: 20px 0;
    background: #f9f9f9;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-content p {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.github-link {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #1a1a1a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid #1a1a1a;
    padding: 8px 16px;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px #1a1a1a;
}

.github-link:hover {
    background: #1a1a1a;
    color: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #666;
}

.github-link:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #666;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}
