/* === Windows === */
.window, .window-special {
    position: fixed;
    background: var(--window-bg);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: min(300px, 90vw);
    max-width: 90vw;
    max-height: 80vh;
    user-select: none;
    opacity: 0;
    pointer-events: auto; /* Re-enable pointer events for windows */
    overflow: hidden;
    z-index: 11; /* Make sure windows are above the carousel */
}

.window.static {
    position: static;
}

/* Rectangular windows */
.window.rectangular, .window-special.window.rectangular {
    width: clamp(500px, 25vw, 800px);
}

.window-header {
    background: var(--window-header);
    padding: var(--spacing-xs);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    position: relative;
    user-select: none; /* Prevent text selection while dragging */
}

.window-controls {
    display: flex;
    gap: 6px;
    z-index: 2; /* Add this to ensure controls are above title */
}

.control {
    width: clamp(8px, 1.5vw, 12px);
    height: clamp(8px, 1.5vw, 12px);
    border-radius: 50%;
    position: relative;
}

.control.red { background-color: var(--control-red); }
.control.yellow { background-color: var(--control-yellow); }
.control.green { background-color: var(--control-green); }

.control.hoverable {
    cursor: pointer;
}

.control.red.hoverable::after {
    content: '×';
    color: black;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
}

.control.red.hoverable:hover::after {
    opacity: 1;
}

.control.yellow.hoverable::after {
    content: '–';
    color: black;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
}

.control.yellow.hoverable:hover::after {
    opacity: 1;
}

.window-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: var(--font-size-small);
    color: #0a0a0a;
    margin: 0;
    z-index: 1; /* Add this to place title below controls */
}

.window-content {
    padding: var(--spacing-sm);
    user-select: text; /* Allow text selection inside the window */
    overflow-y: auto;
    max-height: calc(80vh - 40px);
}

.window-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Message Window */
.message-window {
    width: clamp(280px, 50vw, 350px);
    transition: opacity 0.4s ease;
}

.message-window.fade-out {
    opacity: 0 !important;
}

.message-window .window-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Reduce spacing between paragraphs in message window */
.message-window .window-content p {
    margin: 0 0;
    text-align: left;
    line-height: 1.2;
}

/* Position button in the bottom right */
.message-window .message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    width: 100%;
    height: clamp(20px, 5vw, 30px);
}

/* Newsletter Window */
.window-content .mc4wp-form {
    width: 100%;
}

.message-actions.newsletter {
    justify-content: space-between;
    gap: 20px;
}

.message-actions.newsletter input {
    height: 100%;
}

.message-actions.newsletter p:first-child {
    flex: 1; /* This will make the first paragraph expand to fill available space */
    min-width: 0; /* Prevents overflow issues */
    overflow: hidden; /* Optional: prevents content from overflowing */
    text-overflow: ellipsis; /* Optional: adds ellipsis for overflowing text */
}

.message-actions.newsletter .email {
    background-color: #E3E3E3;
    border-radius: 4px;
    padding-left: 10px !important;
}


/* Welcome Window */
#welcome-window {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Product Notice Window */
#product-notice-window {
    width: clamp(350px, 50vw, 400px);
    background: #43ff5e;
}

#product-notice-window .window-header {
    background: unset;
}

#product-notice-window .window-content {
    padding-top: 0;
}

#product-notice-window .window-content h1 {
    margin-bottom: 15px;
    font-family: 'RetroComputerCondensed', monospace;
    font-size: 3em;
    font-weight: normal;
    line-height: 1em;
}

#product-notice-window .window-content p {
    font-style: italic;
}

#product-notice-window .window-content .important {
    font-weight: bold;
    margin-top: 15px;
}


/* Image Window */
.image-window {
    width: clamp(280px, 20vw, 1000px);
}

.image-window .window-content {
    padding: 0;
    overflow: hidden;
}

.image-window .window-content img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Image Slider Window */
.image-slider-window {
    width: clamp(280px, 20vw, 1000px) !important;
}

.image-slider-window .window-content {
    padding: 0;
    overflow: hidden;
}

/* Video Window */
.video-window {
    width: clamp(280px, 30vw, 1000px)
}

.video-content {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-content iframe,
.video-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.folder-window {
    opacity: 0;
    width: clamp(280px, 70vw, 500px);
}

