﻿﻿ /* Container principale per tutte le modali */
#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

button.window-control.minimize {
    background-color: #3f953f;
}

button.window-control.maximize {
    background-color: #39399c;
}

button.window-control.close {
    background-color: #c41e1e;
}

/* Stile base della modale */
.window-modal {
    position: absolute;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    min-width: 300px;
    min-height: 200px;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 10px;
    overflow-y: auto;
    overflow-x: auto;
    backdrop-filter: blur(800px);
    box-shadow: inset 0 0 50px 10px rgba(255, 255, 255, 0.3), inset 0 0 20px 5px rgba(255, 255, 255, 0.4), 4px 2px 16px 1px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    background-image: linear-gradient(to bottom right, rgba(242, 242, 242, 0.70), rgb(242 242 242 / 85%), rgba(242, 242, 242, 1));
}

    .window-modal.minimized {
        display: none;
    }

    .window-modal.maximized {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0;
    }

/* Header della modale */
.window-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
    height: 40px;
}

/*.window-modal.inactive .window-header {
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #666;
}*/

.window-modal.inactive {
    background-image: linear-gradient(to bottom right, rgb(242 242 242 / 0%), rgb(242 242 242 / 3%), rgb(242 242 242 / 0%));
}

    .window-modal.inactive .window-header {
        background: linear-gradient(180deg, #9c9c9c 0%, #e0e0e0 100%);
        color: #666;
    }

.window-modal .window-header {
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    color: #2196F3;
}

.window-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Anybody', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #040404;
    line-height: 39px;
    letter-spacing: 0px;
    text-transform: uppercase;
}

/* Controlli della finestra */
.window-controls {
    display: flex;
    gap: 4px;
}

.window-control {
    width: 32px;
    height: 24px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 16px;
}

.window-modal.inactive .window-control {
    color: #666;
}

.window-control:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.window-control.close:hover {
    background-color: #e81123;
    color: white;
}

.window-control.minimize:hover {
    background-color: #53bb53;
    color: white;
}

.window-control.maximize:hover {
    background-color: #5252ea;
    color: white;
}

/* Contenuto della modale */
.window-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

    .window-content iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

/* Resize handle */
.resize-handle {
    position: absolute;
    background: transparent;
}

    .resize-handle.n {
        top: 0;
        left: 10px;
        right: 10px;
        height: 5px;
        cursor: ns-resize;
    }

    .resize-handle.s {
        bottom: 0;
        left: 10px;
        right: 10px;
        height: 5px;
        cursor: ns-resize;
    }

    .resize-handle.e {
        right: 0;
        top: 10px;
        bottom: 10px;
        width: 5px;
        cursor: ew-resize;
    }

    .resize-handle.w {
        left: 0;
        top: 10px;
        bottom: 10px;
        width: 5px;
        cursor: ew-resize;
    }

    .resize-handle.ne {
        top: 0;
        right: 0;
        width: 10px;
        height: 10px;
        cursor: nesw-resize;
    }

    .resize-handle.nw {
        top: 0;
        left: 0;
        width: 10px;
        height: 10px;
        cursor: nwse-resize;
    }

    .resize-handle.se {
        bottom: 0;
        right: 0;
        width: 10px;
        height: 10px;
        cursor: nwse-resize;
    }

    .resize-handle.sw {
        bottom: 0;
        left: 0;
        width: 10px;
        height: 10px;
        cursor: nesw-resize;
    }

/* Menu highlighting quando minimizzato */
.menu-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .menu-item:hover {
        background-color: #f0f0f0;
    }

    .menu-item.has-minimized-window {
        background-color: #e3f2fd;
        border-left: 3px solid #0078d4;
    }

/* Loading spinner */
.window-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 14px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0078d4;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* Stili specifici per le modali di dettaglio */
.detail-modal {
    position: fixed !important;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
    backdrop-filter: blur(800px);
    background-image: linear-gradient(to bottom right, rgba(242, 242, 242, 0.70), rgb(242 242 242 / 85%), rgba(242, 242, 242, 1));
    box-shadow: inset 0 0 50px 10px rgba(255, 255, 255, 0.3), inset 0 0 20px 5px rgba(255, 255, 255, 0.4), 4px 2px 16px 1px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border-radius: 10px;
}

    .detail-modal .window-header {
/*        background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);*/
        border-bottom: 1px solid #ccc;
        border-radius: 8px 8px 0 0;
        padding: 8px 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: move;
        user-select: none;
    }

    .detail-modal .window-title {
        font-weight: 600;
        font-size: 14px;
        color: #333;
    }

    .detail-modal .window-controls {
        display: flex;
        gap: 4px;
    }

    .detail-modal .window-control {
        width: 20px;
        height: 20px;
        border: none;
        background: transparent;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        font-size: 14px;
        transition: background-color 0.2s;
    }

        .detail-modal .window-control:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        .detail-modal .window-control.close:hover {
            background: #e74c3c;
            color: white;
        }

    .detail-modal .window-content {
        flex: 1;
        border-radius: 0 0 8px 8px;
    }

    .detail-modal .window-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
        color: #666;
    }

    .detail-modal .spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #3498db;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-bottom: 16px;
    }

    /* Resize handles per modali di dettaglio */
    .detail-modal .resize-handle {
        position: absolute;
        background: transparent;
    }

        .detail-modal .resize-handle.n,
        .detail-modal .resize-handle.s {
            left: 0;
            right: 0;
            height: 6px;
            cursor: ns-resize;
        }

        .detail-modal .resize-handle.n {
            top: 0;
        }

        .detail-modal .resize-handle.s {
            bottom: 0;
        }

        .detail-modal .resize-handle.e,
        .detail-modal .resize-handle.w {
            top: 0;
            bottom: 0;
            width: 6px;
            cursor: ew-resize;
        }

        .detail-modal .resize-handle.e {
            right: 0;
        }

        .detail-modal .resize-handle.w {
            left: 0;
        }

        .detail-modal .resize-handle.ne,
        .detail-modal .resize-handle.nw,
        .detail-modal .resize-handle.se,
        .detail-modal .resize-handle.sw {
            width: 12px;
            height: 12px;
        }

        .detail-modal .resize-handle.ne {
            top: 0;
            right: 0;
            cursor: nesw-resize;
        }

        .detail-modal .resize-handle.nw {
            top: 0;
            left: 0;
            cursor: nwse-resize;
        }

        .detail-modal .resize-handle.se {
            bottom: 0;
            right: 0;
            cursor: nwse-resize;
        }

        .detail-modal .resize-handle.sw {
            bottom: 0;
            left: 0;
            cursor: nesw-resize;
        }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.dashboard-modal {
    backdrop-filter: blur(800px);
    background-image: linear-gradient(to bottom right, rgba(242, 242, 242, 0.50), rgba(242, 242, 242, 0.25), rgba(242, 242, 242, 1));
    box-shadow: inset 0 0 50px 10px rgba(255, 255, 255, 0.3), inset 0 0 20px 5px rgba(255, 255, 255, 0.4), 4px 2px 16px 1px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border-radius: 10px;
}

.row-for-modal {
    display: flex;
    flex-wrap: wrap;
}