/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --source-bg: #4a4a4a;
    --source-dark: #333333;
    --source-light: #7a7a7a;
    --source-text: #e0e0e0;
    --source-highlight: #ffffff;
    --online-color: #88cc88;
    --offline-color: #888888;
}

body {
    background-color: #2b3f5a;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    
    /* Centering the main window */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Tahoma', 'Verdana', sans-serif;
    color: var(--source-text);
    font-size: 11px;
}

a {
    color: var(--source-highlight);
    text-decoration: none;
}

.highlight-link {
    color: #ffd700;
    font-weight: bold;
}

.highlight-link:hover {
    text-decoration: underline;
}

/* 4:3 Window Container */
.source-window {
    width: 90vw;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    background-color: var(--source-bg);
    border-top: 2px solid #666;
    border-left: 2px solid #666;
    border-bottom: 2px solid #222;
    border-right: 2px solid #222;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.8);
}

/* Window Title */
.window-title {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--source-highlight);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: -2px;
    position: relative;
    z-index: 2;
}

.tab {
    padding: 4px 12px;
    background-color: var(--source-dark);
    border-top: 1px solid var(--source-light);
    border-left: 1px solid var(--source-light);
    border-right: 1px solid #222;
    color: #aaa;
    cursor: pointer;
}

.tab.active {
    background-color: var(--source-bg);
    color: var(--source-highlight);
    border-bottom: 2px solid var(--source-bg);
}

/* Main Content Area */
.window-content {
    background-color: var(--source-bg);
    border-top: 2px solid var(--source-light);
    border-left: 2px solid var(--source-light);
    border-bottom: 2px solid #222;
    border-right: 2px solid #222;
    flex-grow: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for inner grid */
.layout-grid::-webkit-scrollbar {
    width: 12px;
}
.layout-grid::-webkit-scrollbar-track {
    background: var(--source-dark);
    border: 1px solid #222;
}
.layout-grid::-webkit-scrollbar-thumb {
    background: var(--source-light);
    border: 1px solid #222;
}

/* Group Boxes (Fieldsets) */
.group-box {
    border: 1px inset rgba(255, 255, 255, 0.1);
    border-top: 1px solid #333;
    border-left: 1px solid #333;
    border-bottom: 1px solid #777;
    border-right: 1px solid #777;
    padding: 12px;
    margin-bottom: 10px;
}

.group-box legend {
    padding: 0 5px;
    color: var(--source-text);
}

.group-box p {
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Retro Low-Quality Images */
img {
    image-rendering: pixelated;
    filter: contrast(1.2) grayscale(0.2);
}

.retro-logo {
    max-width: 200px;
    margin-bottom: 10px;
    display: block;
}

.event-icon {
    width: 24px;
    height: 24px;
    border: 1px solid #222;
    background-color: #000;
}

/* Buttons */
.source-btn {
    background-color: var(--source-bg);
    color: var(--source-text);
    border-top: 2px solid var(--source-light);
    border-left: 2px solid var(--source-light);
    border-bottom: 2px solid #222;
    border-right: 2px solid #222;
    padding: 4px 16px;
    font-family: 'Tahoma', 'Verdana', sans-serif;
    font-size: 11px;
    cursor: pointer;
    display: inline-block;
    margin-top: 5px;
}

.source-btn:active {
    border-top: 2px solid #222;
    border-left: 2px solid #222;
    border-bottom: 2px solid var(--source-light);
    border-right: 2px solid var(--source-light);
    padding: 5px 15px 3px 17px;
}

.small-btn {
    padding: 2px 8px;
    margin-top: 5px;
}

/* Bottom Actions */
.window-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
}

/* Lists and Tags */
.announcement-item {
    margin-bottom: 12px;
}

.announcement-meta {
    color: #aaa;
    font-size: 9px;
    display: block;
    margin-bottom: 2px;
}

.announcement-heading {
    font-size: 11px;
    color: var(--source-highlight);
    margin-bottom: 4px;
}

.members-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.member-tag {
    background-color: var(--source-dark);
    border: 1px solid #222;
    padding: 2px 6px;
    font-size: 10px;
    transition: background-color 0.1s;
}

.member-tag:hover {
    background-color: #555;
}

.member-tag.online {
    color: var(--online-color);
}

.member-tag.offline {
    color: var(--offline-color);
}

/* Event Items */
.event-item {
    display: flex;
    flex-direction: column;
}

.event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.event-date {
    font-weight: bold;
    color: #ffd700;
}

.event-name {
    color: var(--source-highlight);
    font-weight: bold;
    margin-bottom: 2px;
}

.event-host {
    color: #aaa;
    margin-bottom: 8px;
}

.empty-state {
    color: #aaa;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
    .source-window {
        aspect-ratio: auto;
        height: 90vh;
    }
}