/* ========================================
   Windows — Draggable, Closable, Minimizable
   ======================================== */

.window {
    position: absolute;
    min-width: 500px;
    min-height: 350px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.window.open {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.window.minimizing {
    opacity: 0;
    transform: scale(0.6) translateY(100px);
    transition: opacity 0.25s ease-in, transform 0.25s ease-in;
}

.window.active {
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 107, 53, 0.15);
}

/* Title Bar */
.window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    cursor: grab;
    flex-shrink: 0;
    user-select: none;
}

.window-titlebar:active {
    cursor: grabbing;
}

.window-titlebar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.window-titlebar-icon {
    font-size: 18px;
}

.window-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.window-controls {
    display: flex;
    gap: 6px;
}

.window-controls button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 14px;
}

.window-controls button:hover {
    background: rgba(255, 107, 53, 0.12);
    color: var(--orange-700);
}

.window-controls .btn-close:hover {
    background: #E81123;
    color: white;
}

/* Window Body */
.window-body {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    color: var(--text-primary);
    user-select: text;
}

.window-body h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--orange-700), var(--orange-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.window-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--orange-700);
    margin: 24px 0 12px;
}

.window-body h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.window-body p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.window-body .subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Animations */
.window-body .fade-in {
    animation: fadeInUp 0.4s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.window-body .fade-in:nth-child(1) {
    animation-delay: 0.05s;
}

.window-body .fade-in:nth-child(2) {
    animation-delay: 0.1s;
}

.window-body .fade-in:nth-child(3) {
    animation-delay: 0.15s;
}

.window-body .fade-in:nth-child(4) {
    animation-delay: 0.2s;
}

.window-body .fade-in:nth-child(5) {
    animation-delay: 0.25s;
}

.window-body .fade-in:nth-child(6) {
    animation-delay: 0.3s;
}

.window-body .fade-in:nth-child(7) {
    animation-delay: 0.35s;
}

.window-body .fade-in:nth-child(8) {
    animation-delay: 0.4s;
}

.window-body .fade-in:nth-child(9) {
    animation-delay: 0.45s;
}

.window-body .fade-in:nth-child(10) {
    animation-delay: 0.5s;
}

/* Responsive */
@media (max-width: 768px) {
    .window {
        min-width: 320px;
        min-height: 280px;
        width: calc(100vw - 16px) !important;
        left: 8px !important;
    }
}

/* Resize Handle */
.window-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    z-index: 200;
}

.window.is-snapping {
    transition: width 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1), height 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1), top 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1), left 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}