/* ==========================================================================
   STYLE SHEET CONFIGURATION: portal-theme.css
   ========================================================================== */

:root {
    --bg-main: #0b0f19;
    --bg-surface: #151c2c;
    --accent-red: #e62240;
    --accent-blue: #5865f2;
    --text-primary: #ffffff;
    --text-muted: #6b7280;
    --text-online: #10b981;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --shadow-heavy: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--accent-red);
    padding: 14px 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.logo-brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    cursor: pointer;
    text-transform: lowercase;
}

.search-wrapper {
    flex: 0 1 420px;
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s var(--transition-smooth);
}

.search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.search-wrapper input:focus {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.utility-actions {
    display: flex;
    gap: 16px;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
}

.category-strip {
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 4%;
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.category-tag {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.category-tag:hover, .category-tag.active {
    color: var(--text-primary);
}

main {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 4%;
    flex-grow: 1;
}

.section-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header::before {
    content: '';
    width: 4px;
    height: 22px;
    background-color: var(--accent-red);
    border-radius: 2px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.catalog-item {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s var(--transition-smooth), box-shadow 0.25s var(--transition-smooth);
}

.catalog-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-heavy);
}

/* Updated Thumbnail Area to handle 512x512 images correctly */
.media-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    background-color: #1a2333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Clips image edges if they aren't perfectly square */
}

/* Image scaling configuration properties */
.media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Forces image to scale down cleanly without squeezing */
    image-rendering: -webkit-optimize-contrast; /* Keeps high-res artwork looking sharp */
}

.media-container svg {
    width: 45%;
    height: 45%;
    fill: currentColor;
}

.meta-details {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.meta-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-category {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.meta-metrics {
    margin-top: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-online);
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-metrics::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--text-online);
    border-radius: 50%;
}
