/* ==========================================================================
   NexusOS Sonoma / Sequoia Native Application Styles
   ========================================================================== */

.window-body.finder-shell,
.window-body.browser-shell,
.window-body.music-shell,
.window-body.calculator-shell,
.window-body.photos-shell,
.window-body.settings-nexusos-shell,
.window-body.photobooth-shell {
    padding: 0 !important;
    height: calc(100% - 38px) !important;
    overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   1. FINDER APP
   -------------------------------------------------------------------------- */
.finder-shell {
    display: grid;
    grid-template-columns: 200px 1fr;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
}

body[data-shell-mode="dark"] .finder-shell {
    background: rgba(30, 30, 32, 0.9);
    color: #f5f5f7;
}

.finder-sidebar {
    background: rgba(245, 245, 247, 0.6);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

body[data-shell-mode="dark"] .finder-sidebar {
    background: rgba(24, 24, 26, 0.6);
    border-right-color: rgba(255, 255, 255, 0.08);
}

.finder-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 8px;
    margin-bottom: 4px;
}

.finder-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    transition: background 120ms ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.finder-nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body[data-shell-mode="dark"] .finder-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.finder-nav-item.is-active {
    background: var(--accent);
    color: #ffffff;
}

.finder-nav-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.85;
}

.finder-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.finder-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.4);
    gap: 12px;
}

body[data-shell-mode="dark"] .finder-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(30, 30, 32, 0.4);
}

.finder-view-switch {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 2px;
}

body[data-shell-mode="dark"] .finder-view-switch {
    background: rgba(255, 255, 255, 0.1);
}

.finder-view-btn {
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: inherit;
}

.finder-view-btn.is-active {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

body[data-shell-mode="dark"] .finder-view-btn.is-active {
    background: rgba(255, 255, 255, 0.2);
}

.finder-items-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 16px;
    align-content: start;
}

.finder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: background 120ms ease;
    border: 1px solid transparent;
}

.finder-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

body[data-shell-mode="dark"] .finder-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.finder-item.is-selected {
    background: rgba(0, 122, 255, 0.18);
    border-color: rgba(0, 122, 255, 0.4);
}

.finder-item-icon {
    font-size: 38px;
    line-height: 1;
}

.finder-item-name {
    font-size: 12px;
    font-weight: 500;
    word-break: break-word;
    max-width: 90px;
    line-height: 1.25;
}

.finder-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    color: var(--muted-ink);
}

/* --------------------------------------------------------------------------
   2. SAFARI BROWSER
   -------------------------------------------------------------------------- */
.browser-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
}

body[data-shell-mode="dark"] .browser-shell {
    background: #1e1e20;
    color: #f5f5f7;
}

.browser-chrome {
    display: flex;
    flex-direction: column;
    background: rgba(245, 245, 247, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body[data-shell-mode="dark"] .browser-chrome {
    background: rgba(36, 36, 40, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.browser-tab-bar {
    display: flex;
    align-items: center;
    padding: 6px 12px 0 80px; /* Space for traffic lights */
    gap: 6px;
    overflow-x: auto;
}

.browser-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    border: none;
    color: inherit;
}

.browser-tab.is-active {
    background: #ffffff;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

body[data-shell-mode="dark"] .browser-tab.is-active {
    background: #2a2a2e;
}

.browser-navbar {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    gap: 10px;
}

.browser-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 120ms ease, background 120ms ease;
}

.browser-nav-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

body[data-shell-mode="dark"] .browser-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.browser-url-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body[data-shell-mode="dark"] .browser-url-bar {
    background: #2a2a2e;
    border-color: rgba(255, 255, 255, 0.12);
}

.browser-url-bar input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    color: inherit;
    font-size: 12px;
}

.browser-bookmarks {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 14px 6px;
    font-size: 11px;
    color: var(--muted-ink);
    overflow-x: auto;
}

.browser-bookmark-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
}

.browser-bookmark-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent);
}

.browser-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* --------------------------------------------------------------------------
   3. APPLE MUSIC PLAYER
   -------------------------------------------------------------------------- */
.music-shell {
    display: grid;
    grid-template-columns: 210px 1fr;
    height: 100%;
    background: #ffffff;
}

body[data-shell-mode="dark"] .music-shell {
    background: #18181c;
    color: #f5f5f7;
}

.music-sidebar {
    background: rgba(245, 245, 247, 0.7);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body[data-shell-mode="dark"] .music-sidebar {
    background: rgba(26, 26, 30, 0.7);
    border-right-color: rgba(255, 255, 255, 0.08);
}

.music-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.music-player-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.5);
}

body[data-shell-mode="dark"] .music-player-top {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    background: rgba(28, 28, 32, 0.5);
}

.music-now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
}

.music-album-art {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fa2d48 0%, #ff5e3a 100%);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(250, 45, 72, 0.35);
    color: #fff;
    font-size: 24px;
}

.music-track-meta strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.music-track-meta span {
    font-size: 13px;
    color: var(--muted-ink);
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.music-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: inherit;
    transition: transform 120ms ease, background 120ms ease;
}

body[data-shell-mode="dark"] .music-btn {
    background: rgba(255, 255, 255, 0.12);
}

.music-btn:hover {
    transform: scale(1.08);
}

.music-btn--play {
    width: 44px;
    height: 44px;
    background: #fa2d48;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(250, 45, 72, 0.35);
}

.music-btn--play:hover {
    background: #e0263f;
}

.music-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
    padding: 0 8px;
}

.visualizer-bar {
    width: 3px;
    height: 4px;
    background: #fa2d48;
    border-radius: 2px;
    transition: height 100ms ease;
}

.music-playlist {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.music-track-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 120ms ease;
}

.music-track-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

body[data-shell-mode="dark"] .music-track-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.music-track-item.is-playing {
    background: rgba(250, 45, 72, 0.1);
    color: #fa2d48;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. CALCULATOR
   -------------------------------------------------------------------------- */
.calculator-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1c1c1e;
    color: #ffffff;
    user-select: none;
}

.calculator-screen {
    padding: 24px 20px 12px;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 1;
}

.calculator-prev {
    font-size: 14px;
    color: #8e8e93;
    min-height: 20px;
}

.calculator-val {
    font-size: 44px;
    font-weight: 300;
    line-height: 1.1;
    word-break: break-all;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #000000;
    padding: 1px;
}

.calc-btn {
    height: 56px;
    border: none;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    background: #333336;
    color: #ffffff;
    transition: filter 100ms ease;
    display: grid;
    place-items: center;
}

.calc-btn:active {
    filter: brightness(1.3);
}

.calc-btn--func {
    background: #a5a5a5;
    color: #000000;
}

.calc-btn--op {
    background: #ff9f0a;
    color: #ffffff;
    font-size: 22px;
}

.calc-btn--op.is-active {
    background: #ffffff;
    color: #ff9f0a;
}

.calc-btn--zero {
    grid-column: span 2;
    place-items: center flex-start;
    padding-left: 28px;
}

/* --------------------------------------------------------------------------
   5. PHOTOS GALLERY
   -------------------------------------------------------------------------- */
.photos-shell {
    display: grid;
    grid-template-columns: 200px 1fr;
    height: 100%;
    background: #ffffff;
}

body[data-shell-mode="dark"] .photos-shell {
    background: #1c1c1e;
    color: #f5f5f7;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    padding: 20px;
    overflow-y: auto;
}

.photo-card {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #e5e5ea;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.photo-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-card-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 8px 10px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. SYSTEM SETTINGS (NexusOS Ventura/Sonoma/Sequoia style)
   -------------------------------------------------------------------------- */
.settings-nexusos-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    height: 100%;
    background: rgba(246, 246, 248, 0.95);
}

body[data-shell-mode="dark"] .settings-nexusos-shell {
    background: #1e1e20;
    color: #f5f5f7;
}

.settings-nexusos-sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

body[data-shell-mode="dark"] .settings-nexusos-sidebar {
    border-right-color: rgba(255, 255, 255, 0.08);
}

.settings-nexusos-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    width: 100%;
}

.settings-nexusos-nav:hover {
    background: rgba(0, 0, 0, 0.05);
}

body[data-shell-mode="dark"] .settings-nexusos-nav:hover {
    background: rgba(255, 255, 255, 0.08);
}

.settings-nexusos-nav.is-active {
    background: var(--accent);
    color: #ffffff;
}

.settings-nexusos-body {
    padding: 24px 32px;
    overflow-y: auto;
}

.settings-group {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

body[data-shell-mode="dark"] .settings-group {
    background: #2a2a2e;
    border-color: rgba(255, 255, 255, 0.08);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 13px;
}

body[data-shell-mode="dark"] .settings-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.settings-row:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   7. PHOTO BOOTH
   -------------------------------------------------------------------------- */
.photobooth-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000000;
    color: #ffffff;
}

.photobooth-viewport {
    flex: 1;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.photobooth-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera */
}

.photobooth-canvas {
    display: none;
}

.photobooth-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px;
    background: #1c1c1e;
}

.shutter-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ff3b30;
    border: 4px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.5);
    transition: transform 120ms ease;
}

.shutter-btn:active {
    transform: scale(0.92);
}

.photobooth-effects {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    background: #111113;
    overflow-x: auto;
}

.effect-chip {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    background: #2c2c2e;
    color: #fff;
    border: none;
    cursor: pointer;
}

.effect-chip.is-active {
    background: var(--accent);
}
