/* 
 * Impreza Child Theme - Desktop Style CSS
 * 
 * A responsive macOS desktop-inspired interface
 */


/* Custom font  */
@font-face {
    font-family: 'RetroComputerCondensed';
    src: url('../fonts/retro_computer_condensed.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === Draggable elements === */
.draggable {
    cursor: move; /* fallback if grab cursor is unsupported */
    cursor: grab;
    cursor: -moz-grab;
    cursor: -webkit-grab;
}

.draggable:active {
    cursor: grabbing;
    cursor: -moz-grabbing;
    cursor: -webkit-grabbing;
}

/* === Top Navigation === */
.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--content-padding);
    position: relative;
    height: var(--header-impreza-height);
}

.logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    height: var(--logo-relative-height);
    perspective: 1000px; /* Adds perspective to create 3D effect */
}

.logo img {
    height: 100%;
    width: auto;
    max-width: 100%;
    animation: logo-yaw-rotation 8s infinite linear; /* 8-second rotation cycle, linear timing, infinite loop */
    transform-style: preserve-3d; /* Preserves the 3D effect */
    backface-visibility: visible; /* Shows the back face during animation */
    transform-origin: center center; /* Rotation happens around the center */
}

/* Adding hover pause for better user experience */
.logo:hover img {
    animation-play-state: paused;
}


/* === Cart Icon Styles === */
.cart-icon-container {
    display: block;
    position: relative;
    text-decoration: none;
    line-height: 0;
}

.cart-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-icon {
    width: clamp(18px, 2vw, 24px);
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #27c93f;
    color: white;
    font-size: var(--font-size-small);
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: bold;
    line-height: 1;
    box-sizing: border-box;
}

/* Cart icon in menu */
.menu-cart {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .menu-cart {
        margin-top: var(--spacing-xs);
    }
}

/* Cart icon in product modal */
.product-modal-cart-wrap {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    z-index: 10;
}

.product-modal-cart-wrap .modal-cart {
    padding: 5px;
}

.modal-cart .cart-icon {
    width: clamp(20px, 2.5vw, 26px);
}

.modal-cart .cart-count {
    min-width: 20px;
    height: 20px;
    top: -8px;
    right: -8px;
}

/* === Containers === */
.main-content {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 var(--content-padding);
}

.desktop-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* This allows events to pass through to elements below */
    z-index: 10;
    padding: inherit;
}

/* Desktop Clock */
.desktop-clock {
    position: absolute;
    bottom: 0;
    right: var(--content-padding);
    font-size: 3em;
    line-height: 1em;
    font-family: 'RetroComputerCondensed', monospace;
    pointer-events: none; /* Keep it non-interactive like the container */
}

.content-container {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    z-index: 1;
}

/* === Background === */
.background-products {
    position: absolute;
    display: flex;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: max(10px, 1vw);
    z-index: 2; /* Set higher than base content but lower than desktop elements */
    box-sizing: border-box;
    /* Add negative margins to counteract parent padding */
    margin-left: calc(-1 * var(--content-padding));
    margin-right: calc(-1 * var(--content-padding));
    /* Adjust width to account for the negative margins */
    width: calc(100% + 2 * var(--content-padding)); 
}

.background-text {
    position: absolute;
    height: clamp(20%, 30vh, 40%);
    z-index: -99;
    padding: 0 calc(var(--spacing-sm) / 2) 0 0;
    bottom: 90px;
    right: 0;
}

.background-text picture {
    height: 100%;
}

.background-text img {
    height: 100%;
    width: auto;
}

/* === Desktop Folders === */

.folders-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.folders-container.bottom-left {
    position: absolute;
    bottom: 0;
}

.folders-container.bottom-right {
    position: absolute;
    bottom: 0;
    right: var(--content-padding);
}

.folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(70px, 10vw, 100px);
    opacity: 1;
    pointer-events: auto; /* Re-enable pointer events for folders */
}

.folder-icon-container {
    position: relative;
    width: 100%;
    height: clamp(70px, 10vw, 100px);
    display: flex;
    justify-content: center;
}

.folder-icon {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(1px 4px 7px rgba(0, 0, 0, 0.4));
    object-position: bottom;
}

.folder span {
    font-size: var(--font-size-small);
    text-align: center;
    margin-top: 8px;
    word-break: break-word;
}

.folder.open .folder-icon-container::after {
    content: '';
    width: 100%;
    height: 4px; /* Height of the blue bar */
    background-color: #76B9ed; /* Color of the bar */
    position: absolute;
    bottom: -10px;
    left: 0;
}

#trash-icon {
    width: 90%;
}


.ok-btn {
    background: #00b4ff;
    color: rgb(0, 0, 0);
    border: none;
    padding: 0 var(--spacing-sm);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-style: none !important;
    font-weight: bold;
}

.ok-btn:hover {
    background: #0090cc;
}


/*--------------------------------------------------------------
# macOS Style \fication
--------------------------------------------------------------*/
.macos-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-width: 90%;
    background-color: rgba(240, 240, 240, 0.9); /* Semi-transparent light background */
    backdrop-filter: blur(10px); /* macOS blur effect */
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start; /* Align items to the top */
    z-index: 10000; /* Ensure it's on top */
    opacity: 0;
    transform: translateX(100%); /* Start off-screen */
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* System font */
    color: #333;
}

.macos-notification.error {
    background-color: rgba(255, 230, 230, 0.9); /* Light red background for errors */
}

.notification-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    flex-shrink: 0; /* Prevent icon from shrinking */
    margin-top: 2px; /* Align icon slightly better */
}

.notification-content {
    flex-grow: 1; /* Allow content to take remaining space */
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.notification-message {
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 10px; /* Add padding to increase click area */
    margin-left: auto; /* Push close button to the right */
    align-self: flex-start; /* Keep it top-aligned */
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
    color: #555;
}

/* Responsive adjustments for notifications */
@media (max-width: 480px) {
    .macos-notification {
        width: calc(100% - 20px); /* Adjust width for small screens */
        right: 10px;
        top: 10px;
        padding: 12px;
    }
    .notification-icon {
        font-size: 1.3rem;
        margin-right: 10px;
    }
    .notification-title {
        font-size: 0.9rem;
    }
    .notification-message {
        font-size: 0.85rem;
    }
}

/* === Footer === */
.desktop-footer {
    width: 100%;
    text-align: center;
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-medium);
}

.vc_hidden-md, body:not(.usb_preview) .hide_on_default,
.vc_hidden-md, body:not(.usb_preview) .hide_on_laptops {
    display: none !important;
}

.toplink {
    display: none !important;
}

.w-header-show {
    display: none !important;
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    .top-menu {
        flex-direction: column;
        height: auto;
        gap: var(--spacing-sm);
    }

    .brand-info {
        text-align: center;
        margin-bottom: var(--spacing-xs);
    }

    .menu-items {
        width: 100%;
        justify-content: center;
    }

    .desktop-footer {
        position: relative;
        bottom: 0;
    }
}

@media (max-width: 480px) {
    .menu-items {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xs);
    }
    
    .window, .window-special {
        min-width: 85vw;
    }
}