﻿:root {
    --ss-bg1: #ff6b35;
    --ss-bg2: #f97316;
    --ss-bg3: #7c2d12;
    --ss-accent: #ffcc4d;
    --ss-accent-strong: #ff8a00;
    --ss-window-blue: #0053a6;
    --ss-window-border: #0c1c33;
    --ss-text: #f5f5f5;
    --ss-panel-bg: #111827dd;
    --ss-panel-border: #1f2937;
    --ss-card-bg: #f9f5eb;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Desktop background */
body {
    background: radial-gradient(circle at top left, var(--ss-bg1), var(--ss-bg2))
    fixed;
    color: var(--ss-text);
}

/* Desktop wrapper */
.ss-desktop {
    position: relative;
    min-height: 100vh;
    padding-top: 3rem;
    padding-bottom: 2.5rem;
    box-sizing: border-box;
}

/* Big SafaScript logo in background */
.ss-boot-logo {
    position: fixed;
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;          /* stay behind windows */
}

.ss-boot-logo img {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
}

/* Make windows and content float above logo */
.ss-window,
.page-container,
.ss-taskbar {
    position: relative;
    z-index: 10;
}


/* Main page container inside windows */
.page-container {
    padding: 1.2rem 1rem 1.4rem;
}

/* Window */
.ss-window {
    max-width: 1100px;
    margin: 1.5rem auto;
    border-radius: 18px;
    background: linear-gradient(
            145deg,
            rgba(17, 24, 39, 0.96),
            rgba(17, 24, 39, 0.96)
    );
    box-shadow:
            0 18px 60px rgba(0, 0, 0, 0.55),
            0 0 0 1px rgba(15, 23, 42, 0.9);
    overflow: hidden;
    color: #e5e7eb;
}

.ss-window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: radial-gradient(circle at top left, #0f172a, #020617);
    border-bottom: 1px solid #1f2937;
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

.ss-window-title-text {
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ss-window-buttons a,
.ss-window-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 0.8rem;
    background: #991b1b;
    color: #fee2e2;
    text-decoration: none;
    cursor: pointer;
}

.ss-window-body {
    max-height: calc(100vh - 150px);
    overflow: auto;
}

/* Taskbar */
.ss-taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42px;
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    box-sizing: border-box;
    color: #e5e7eb;
    font-size: 0.8rem;
    z-index: 50;
}

.ss-taskbar-start {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ss-taskbar-logo {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    object-fit: cover;
}

.ss-taskbar-apps {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.ss-taskbar-link {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-decoration: none;
    color: #e5e7ebcc;
    border: 1px solid transparent;
    font-size: 0.78rem;
}

.ss-taskbar-link:hover {
    border-color: #4b5563;
    background: #111827;
}

.ss-taskbar-tray {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ss-tray-text {
    opacity: 0.85;
}

#logoutControl {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #b91c1c;
    cursor: pointer;
    font-size: 0.78rem;
}

/* Desktop app tiles */
.ss-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    cursor: pointer;
    user-select: none;

    width: 140px;
    padding: 1.4rem 1.1rem 1.1rem;
    border-radius: 1.75rem;

    background: rgba(15,23,42,0.96);
    box-shadow:
            0 18px 40px rgba(0,0,0,0.75),
            0 0 0 1px rgba(148,163,184,0.25);

    transition:
            transform 0.12s ease-out,
            box-shadow 0.12s ease-out,
            filter 0.12s ease-out;
}

/* Emoji inside icon */
.ss-icon-emoji {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

/* Label under emoji */
.ss-icon span {
    font-size: 0.82rem;
    color: #e5e7eb;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Hover effect */
.ss-icon:hover {
    transform: translateY(-6px);
    box-shadow:
            0 24px 55px rgba(0,0,0,0.9),
            0 0 0 1px rgba(248,250,252,0.25);
    filter: brightness(1.05);
}


/* Cookie banner */
.cookie-banner {
    z-index: 999999 !important;
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
}


body:not(.ss-consent-given) .ss-external-embed {
    display: none;
}


body:not(.ss-consent-given) .ss-external-placeholder {
    display: block;
}


/* Shutdown overlay */
.ss-shutdown-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, #111827 0%, #020617 52%, #000 100%);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #e5e7eb;
    z-index: 999;
}

.ss-shutdown-overlay.active {
    display: flex;
}

.ss-shutdown-title {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.ss-shutdown-sub {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Generic forms & headings inside window */
h1,
h2,
h3,
h4 {
    color: #e5e7eb;
}

.ui.segment {
    background: rgba(17, 24, 39, 0.9) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(55, 65, 81, 0.8) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

/* LAPR layout */
.lapr-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.8rem;
}

.lapr-filters {
    padding: 1rem;
    border-radius: 12px;
    background: #111827;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.9);
}

.lapr-filters .ui.header {
    color: #e5e7eb;
    margin-bottom: 0.7rem;
}

.lapr-main h3.ui.header {
    margin-top: 0;
}

.lapr-thread-card {
    background: var(--ss-card-bg);
    border-radius: 16px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #111827;
}

.lapr-thread-header {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.lapr-thread-meta {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 0.6rem;
}

.lapr-thread-body {
    margin-bottom: 0.8rem;
}

.lapr-thread-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.lapr-thread-comments {
    margin-top: 0.9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.45);
    padding-top: 0.6rem;
}

/* Comments */
.comment {
    margin-left: 1.4rem;
    border-left: 1px solid rgba(148, 163, 184, 0.7);
    padding-left: 0.6rem;
    margin-top: 0.4rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: #e5e7eb;
    color: #4b5563;
}

.comment-body {
    margin: 0.2rem 0 0.3rem;
    color: #111827;
}

.comment-vote {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

/* Third-party integrations window */
.thirdparty-page {
    max-width: 820px;
}

.thirdparty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.4rem;
    margin-top: 1rem;
}

.thirdparty-card {
    background: #111827;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(55, 65, 81, 0.9);
}

.thirdparty-card h3 {
    margin-top: 0;
    margin-bottom: 0.3rem;
    color: #e5e7eb;
}

.thirdparty-card p {
    font-size: 0.85rem;
    color: #d1d5db;
}

.btn-primary {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

/* === Third-party embedded integrations === */

.thirdparty-embeds {
    margin-top: 2rem;
}

.thirdparty-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.thirdparty-embed-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* reuse .thirdparty-card look, just control sizing */
.thirdparty-embed-row .thirdparty-card {
    flex: 1 1 420px;
}

/* responsive embeds (16:9) */
.embed-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: 0.9rem;
    overflow: hidden;
    margin-top: 0.6rem;
}

.embed-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* mobile: stack vertically */
@media (max-width: 768px) {
    .thirdparty-embed-row {
        flex-direction: column;
    }
}

.thirdparty-github-stats .label {
    font-weight: 600;
    margin-right: 0.4rem;
}

.thirdparty-github-stats .value {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.thirdparty-github-stats p {
    margin: 0.2rem 0;
}


/* ===== Home desktop 2-column layout ===== */

.ss-main-layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

/* Left side: icons grid */
.ss-main-left {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

/* Make sure icons don’t stretch weirdly */
.ss-main-left .ss-icon {
    flex: 0 0 auto;
}

/* Right side: News box */
.ss-main-right {
    width: 320px;
    max-width: 35%;
}

/* News box styling */
.ss-news-box {
    background: rgba(15,23,42,0.96);
    border-radius: 1.25rem;
    padding: 1rem 1.2rem 1.1rem;
    box-shadow:
            0 18px 40px rgba(15,23,42,0.8),
            0 0 0 1px rgba(148,163,184,0.12);
    color: #e5e7eb;
}

.ss-news-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.ss-news-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 0.6rem;
}

.ss-news-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.9rem;
}
.ss-news-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.9rem;
    object-fit: cover;
}


.ss-news-caption {
    font-size: 0.85rem;
    color: #cbd5f5;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .ss-main-layout {
        flex-direction: column;
    }

    .ss-main-right {
        width: 100%;
        max-width: 100%;
    }
}
