/* ===================================================================
   Nullrift Homepage — Styles
   Extends 98.css with homepage-specific layout and decoration support.
   Scaled up to 18px base to match K-Files / Authelia / Register theme.
   =================================================================== */

/* === Scale Overrides (match register.css 18px base) === */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
    font-size: 18px;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    background-color: #1a1a2e;
    background-repeat: repeat;
    min-height: 100vh;
    color: #000;
}

.window,
button,
input,
label,
legend {
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
    font-size: 18px;
}

/* === Buttons (scaled) === */
button,
input[type=reset],
input[type=submit] {
    min-height: 38px;
    min-width: 120px;
    padding: 0 20px;
}

/* === Title Bar (scaled) === */
.title-bar {
    padding: 4px 3px 4px 6px;
}

.title-bar-text {
    font-size: 18px;
    font-weight: 700;
}

/* === Title Bar Controls (scaled to match register.css / K-Files) === */
.title-bar-controls button {
    display: block;
    min-height: 28px;
    min-width: 28px;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 14px;
}
.title-bar-controls button:active {
    padding: 0;
}
.title-bar-controls button:focus {
    outline: none;
}
.title-bar-controls button[aria-label=Close],
.title-bar-controls button[aria-label].close {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0V0z' fill='%23000'/%3E%3C/svg%3E");
    background-position: center;
    margin-left: 2px;
}

/* === Window Body === */
.window-body {
    margin: 8px;
}

/* === Status Bar === */
.status-bar-field {
    font-size: 16px;
}

/* === Splash Overlay === */
.splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.4s ease;
}
.splash.hidden {
    opacity: 0;
    pointer-events: none;
}
.splash-content {
    max-width: 400px;
    text-align: center;
}
.splash-body {
    padding: 24px 36px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.splash-gif {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
}
.splash-text {
    font-size: 20px;
    margin: 0;
    font-weight: bold;
}

/* === Decoration Layer === */
.decorations {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.decorations img {
    position: absolute;
    image-rendering: pixelated;
}

/* Decoration position helpers */
.deco-top-left      { top: 2rem;  left: 2rem; }
.deco-top-right     { top: 2rem;  right: 2rem; }
.deco-bottom-left   { bottom: 2rem; left: 2rem; }
.deco-bottom-right  { bottom: 2rem; right: 2rem; }
.deco-center-left   { top: 50%; left: 2rem; transform: translateY(-50%); }
.deco-center-right  { top: 50%; right: 2rem; transform: translateY(-50%); }

/* === Page Layout === */
.page-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px 140px;
    box-sizing: border-box;
}

/* === Header / Branding === */
.header-area {
    text-align: center;
    margin-bottom: 30px;
}
.site-logo {
    height: 65px;
    width: auto;
    image-rendering: pixelated;
}

/* === App Launcher Window === */
.launcher-window {
    max-width: 540px;
    width: 100%;
}
.launcher-body {
    padding: 24px !important;
}

/* === App Grid (Desktop Shortcut Style) === */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 20px;
    justify-items: center;
}
.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    text-decoration: none;
    color: #000;
    cursor: pointer;
    border: 2px solid transparent;
    min-width: 90px;
}
.app-icon:hover {
    background: #000080;
    color: #fff;
    border: 2px dotted #fff;
}
.app-icon:hover .app-label {
    color: #fff;
}
.app-icon img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}
.app-label {
    font-size: 16px;
    text-align: center;
    word-break: break-word;
}
.app-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* === Audio Player (matches K-Files styling) === */
.audio-player {
    display: none; /* Shown after splash click */
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 900;
}
.audio-player.visible {
    display: block;
}
.audio-player-main {
    width: 380px;
    font-size: 14px;
}
.audio-player-main > .window-body {
    display: flex;
    padding: 0;
}
.audio-player-body-main {
    flex: 1;
    padding: 8px;
    min-width: 0;
}
.track-name {
    margin-bottom: 6px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.audio-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}
.audio-controls button {
    min-width: 32px;
    min-height: auto;
    height: 24px;
    padding: 2px 4px;
    font-size: 14px;
}
.btn-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}
.audio-seek-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.audio-seek {
    flex: 1;
    min-width: 0;
    height: 16px;
    background: #c0c0c0;
}
.audio-time {
    font-size: 14px;
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
    white-space: nowrap;
    min-width: 70px;
    flex-shrink: 0;
    text-align: center;
}
.audio-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}
.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
}
.vol-label {
    font-size: 14px;
}
.audio-volume {
    width: 60px;
    height: 16px;
    background: #c0c0c0;
}
.btn-reshuffle {
    font-size: 14px;
    min-width: auto;
    min-height: auto;
    height: 24px;
    padding: 2px 8px;
}

/* === Audio Player Toggle Button (top-right, matches K-Files) === */
.header-btn-right {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    gap: 5px;
}
.header-btn-right a {
    display: block;
}
.header-btn-right img {
    display: block;
    image-rendering: pixelated;
}

/* === Responsive === */
@media (max-width: 600px) {
    .decorations { display: none; }
    .site-logo { height: 50px; }
    .launcher-window { max-width: 100%; }
    .app-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
    .audio-player-main { width: 300px; }
    .page-container { padding: 20px 10px 140px; }
}
