/* Windows 11 Fluent Polish Theme - Dark Mode */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

:root {
    --window-bg: rgba(32, 32, 32, 0.9);
    /* Dark background */
    --mica-tint: #202020;
    --text-primary: #ffffff;
    /* White text */
    --text-secondary: #d0d0d0;
    /* Light grey text */
    --accent-color: #60cdff;
    /* Lighter blue for dark mode */
    --accent-hover: #50b8eb;
    --accent-pressed: #40a0d0;
    --border-color: rgba(255, 255, 255, 0.08);
    /* White transparent border */
    --hover-bg: rgba(255, 255, 255, 0.06);
    /* White hover */
    --pressed-bg: rgba(255, 255, 255, 0.04);
    --selected-bg: rgba(255, 255, 255, 0.08);
    --control-radius: 4px;
    --window-radius: 10px;
    --layer-fill: rgba(44, 44, 44, 0.7);
    /* Slightly lighter dark layer */
}

* {
    box-sizing: border-box;
}

body {
    background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?q=80&w=2070&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent body scroll */
}

/* Custom Win11 Scrollbar (Dark) */
::-webkit-scrollbar {
    width: 6px;
    /* Thin scrollbar */
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Window Container */
.win11-window {
    width: 960px;
    height: 640px;
    background: var(--window-bg);
    border-radius: var(--window-radius);
    /* Win11 Dark Shadow */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 32px 64px rgba(0, 0, 0, 0.4), 0 2px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(50px) saturate(120%);
    /* Mica Alt Simulation */
    -webkit-backdrop-filter: blur(50px);
    transition: all 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
    transform-origin: center bottom;
}

.win11-window.maximized {
    width: calc(100vw - 40px) !important;
    height: calc(100vh - 80px) !important;
    margin: 20px;
}

.win11-window.minimized {
    opacity: 0;
    transform: scale(0.7) translateY(400px);
    pointer-events: none;
}

/* Taskbar Style */
.taskbar {
    position: fixed;
    bottom: -60px;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(32, 32, 32, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: bottom 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
    z-index: 9000;
}

.taskbar.active {
    bottom: 0;
}

.taskbar-icons {
    display: flex;
    gap: 12px;
    padding: 0 10px;
}

.taskbar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--accent-color);
}

.taskbar-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-icon.tools {
    position: relative;
}

.taskbar-icon.tools::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 10px;
}

/* Title Bar */
.title-bar {
    height: 48px;
    /* Taller standard title bar */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 16px;
    user-select: none;
    -webkit-app-region: drag;
    font-size: 12px;
}

.title-bar-icon {
    display: flex;
    align-items: center;
    margin-right: 12px;
    font-size: 18px;
    color: var(--accent-color);
    /* Tint icon with accent */
}

.title-bar-text {
    flex: 1;
    font-weight: 400;
}

.title-bar-controls {
    display: flex;
    height: 100%;
}

.control-btn {
    background: transparent;
    border: none;
    width: 46px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: var(--text-primary);
    transition: background 0.1s;
    cursor: default;
    -webkit-app-region: no-drag;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.control-btn.close:hover {
    background: #c42b1c;
    color: white;
}

/* Window Body */
.window-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    /* Prevent resize issues */
}

/* Sidebar (Nav Rail) */
.nav-rail {
    width: 280px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.1s;
    user-select: none;
    position: relative;
    margin: 0 4px;
}

.nav-item:hover {
    background: var(--hover-bg);
}

.nav-item:active {
    background: var(--pressed-bg);
}

.nav-item.active {
    background: var(--selected-bg);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 2px;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--text-primary);
}

.nav-item.active i {
    color: var(--accent-color);
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--layer-fill);
    /* Layer fill */
    border-top-left-radius: 8px;
    /* Top left rounding */
    border-bottom-left-radius: 0;
    /* Full extend to bottom, looking cleaner */
    margin: 8px 8px 8px 0;
    /* Gap from sidebar */
    padding: 0;
    /* Reset padding, use inner containers */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    /* Darker shadow */
    overflow: hidden;
    /* For rounded corners */
}

/* Header inside Content */
.header-area {
    padding: 32px 32px 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Don't shrink header */
}

.header-area h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 8px 10px 8px 36px;
    border: 1px solid var(--border-color);
    border-bottom: 2px solid transparent;
    /* Prepare for accent */
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    /* Dark input bg */
    transition: all 0.2s;
}

.search-box input:hover {
    background: rgba(255, 255, 255, 0.08);
}

.search-box input:focus {
    background: #1e1e1e;
    /* Darker focus */
    border-bottom-color: var(--accent-color);
    border-top-color: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.1);
    border-right-color: rgba(255, 255, 255, 0.1);
}

/* List Headers */
.list-header {
    display: grid;
    grid-template-columns: 48px 2fr 100px 100px;
    /* Check, Name, System, Size */
    /* Check, Name, System, Size */
    padding: 0 32px 8px 32px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    user-select: none;
    flex-shrink: 0;
}

/* Scrollable List Area */
.list-scroll-area {
    flex: 1;
    /* Take remaining height */
    overflow-y: overlay;
    /* Use overlay scroll if valid */
    padding: 8px 16px 8px 32px;
    /* Pad right for scrollbar */
    min-height: 0;
    /* CRITICAL FIX for flex overflow */
}

/* Column Alignment */
.col-size {
    text-align: right;
    padding-right: 12px;
}

.col-os {
    text-align: center;
}

/* Row Item */
.win-row {
    display: grid;
    grid-template-columns: 48px 2fr 100px 100px;
    /* Check, Name, System, Size */
    padding: 8px 0;
    align-items: center;
    border-radius: 4px;
    cursor: default;
    font-size: 14px;
    margin-bottom: 2px;
    transition: background 0.1s;
}

.win-row:hover {
    background: var(--hover-bg);
}

.win-row.selected {
    background: var(--selected-bg);
}

/* Checkbox */
.col-check {
    display: flex;
    justify-content: center;
}

input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Lighter border */
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

input[type="checkbox"]:checked:hover {
    background: var(--accent-hover);
}

input[type="checkbox"]:checked::after {
    content: '\f00c';
    /* FontAwesome check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #000;
    /* Black Checkmark on light accent */
    font-size: 12px;
}

/* Status Bar */
.status-bar {
    height: 64px;
    background: rgba(30, 30, 30, 0.5);
    /* Dark tint */
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
    /* Don't shrink */
}

#status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Buttons */
.win11-btn {
    padding: 6px 20px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s;
    border: none;
    min-width: 80px;
    user-select: none;
}

.win11-btn.primary {
    background: var(--accent-color);
    color: #1a1a1a;
    /* Dark text on light accent */
    border: 1px solid transparent;
}

.win11-btn.primary:hover {
    background: var(--accent-hover);
}

.win11-btn.primary:active {
    background: var(--accent-pressed);
    transform: scale(0.98);
}

.win11-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.win11-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.win11-btn.secondary:active {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(0.98);
}

.win11-btn.small {
    padding: 4px 12px;
    font-size: 12px;
    min-width: auto;
}

.actions {
    display: flex;
    gap: 8px;
}

/* Modal */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Darker dim */
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-window {
    width: 650px;
    max-height: 80vh;
    /* Prevent modal overflow on small windows */
    display: flex;
    flex-direction: column;
    background: #2c2c2c;
    /* Dark modal bg */
    border-radius: 8px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
}

.close-modal-btn:hover {
    background: var(--hover-bg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
    /* Space for scrollbar */
}

/* Modal text should be white */
.modal-body p {
    color: var(--text-primary);
}

.download-list .download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    /* Dark item bg */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

/* Elegant Horizontal Slider View for Windows */
.preset-slider-container {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 80px;
    /* More breathing room */
    background: rgba(20, 20, 20, 0.4);
    overflow: hidden;
    user-select: none;
}

.preset-slider {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preset-card-large {
    width: 100%;
    max-width: 860px;
    height: 100%;
    max-height: 480px;
    background: rgba(32, 32, 32, 0.7);
    backdrop-filter: blur(50px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    /* Win11 standard */
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    transition: all 0.6s cubic-bezier(0.1, 0.9, 0.2, 1);
    animation: winSliderIn 0.7s cubic-bezier(0.1, 0.9, 0.2, 1) both;
}

.check-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    z-index: 10;
}

.preset-card-large.selected .check-indicator {
    opacity: 1;
    transform: scale(1);
}

@keyframes winSliderIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-half-media {
    width: 50%;
    height: 100%;
    background: #000;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.card-half-media img,
.card-half-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.preset-card-large:hover .card-half-media img,
.preset-card-large:hover .card-half-media video {
    transform: scale(1.04);
}

.card-half-info {
    width: 50%;
    height: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.preset-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.preset-card.selected {
    background: rgba(0, 103, 192, 0.1);
    border-color: #0067C0;
}

.selection-overlay {
    position: absolute;
    inset: 0;
    border: 3px solid var(--accent-color);
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preset-card-large.selected .selection-overlay {
    opacity: 1;
}

.preset-card-large.selected {
    background: rgba(0, 120, 212, 0.1);
}

.card-info {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow: hidden;
    justify-content: center;
    color: #ffffff;
}

/* Custom Windows-style Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid transparent;
    background-clip: content-box;
}

.info-item {
    display: flex;
    font-size: 13px;
    gap: 16px;
    line-height: 1.6;
}

.info-label {
    color: rgba(255, 255, 255, 0.5);
    width: 100px;
    flex-shrink: 0;
    font-weight: 600;
}

.info-value {
    color: #ffffff;
    font-weight: 400;
}

.card-name {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

/* Slider Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(45, 45, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-arrow.left {
    left: 16px;
}

.nav-arrow.right {
    right: 16px;
}

.nav-arrow.disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

.card-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.format-tag {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    font-weight: 600;
}

.selection-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.preset-card.selected .selection-indicator {
    background: #0067C0;
    border-color: #0067C0;
}

.preset-card.selected .selection-indicator::after {
    content: "\e10b";
    font-family: "Segoe Fluent Icons";
    font-size: 10px;
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Warning */
.mobile-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #202020;
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: #ffffff;
}

.warning-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

@media (max-width: 800px) {
    .mobile-warning {
        display: flex;
    }

    .win11-window {
        display: none !important;
    }
}