/**
 * Windows 11 Taskbar - Isolated CSS
 * All selectors are namespaced with .w11- to prevent conflicts
 * Critical positioning uses !important to override any theme styles
 */

/* CSS Variables - Global scope so both taskbar and start menu can access */
:root {
    --w11-nav-height: 3rem;
    --w11-img-nav-height: calc(var(--w11-nav-height) - 1.5rem);
    --w11-glass-white-color: rgba(255, 255, 255, 0.1);
}

/* Wrapper for taskbar and start menu - inherit variables from Elementor wrapper */
.w11-taskbar-wrapper {
    --w11-nav-height: 3rem;
    --w11-img-nav-height: calc(var(--w11-nav-height) - 1.5rem);
    --w11-glass-white-color: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.w11-taskbar-nav {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* CRITICAL: Taskbar positioning - NEVER allow override */
.w11-taskbar-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: var(--w11-nav-height) !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    
    /* Styling */
    background: linear-gradient(rgba(0, 0, 85, 0.075), transparent, rgba(0, 0, 85, 0.192)), rgba(32, 32, 32, .50);
    box-shadow: 0 0 1em rgba(0, 0, 255, 0.027);
    backdrop-filter: blur(5em);
    -webkit-backdrop-filter: blur(5em);
    border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.w11-nav-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: var(--w11-nav-height) !important;
    width: 100% !important;
}

.w11-first-container,
.w11-second-container {
    display: flex !important;
    height: 100% !important;
    width: auto !important;
    gap: 0.5rem !important;
    align-items: center !important;
    justify-content: center !important;
}

.w11-second-container {
    gap: 0rem !important;
}

.w11-first-container div svg,
.w11-first-container div img,
.w11-second-container div svg,
.w11-second-container div img {
    aspect-ratio: 1;
    height: var(--w11-img-nav-height);
    width: auto;
    border-radius: 0.1em;
}

/* Logo styling */
.w11-loquatics-logo,
.w11-custom-logo {
    display: block;
}

.w11-loquatics-logo path {
    fill: white;
}

.w11-first-container {
    margin: auto;
}

.w11-sistema-info div {
    display: grid;
    place-content: center;
}

.w11-sistema-info {
    height: 80%;
    gap: 0.5em;
    padding: 0 0.5em;
    border-radius: 0.5em;
    transition-duration: 0.5s;
    color: white;
    margin-right: 0.5em;
    display: grid;
    grid-auto-flow: column;
}

.w11-sistema-data {
    height: 80%;
    padding: 0 1em !important;
    color: white;
    margin-right: 0.5em;
    border-radius: 0.5em;
    display: flex;
    flex-direction: column;
    font-size: 0.65em;
    align-items: flex-end;
    justify-content: center;
}

.w11-sistema-info:hover,
.w11-sistema-data:hover {
    background-color: rgba(255, 255, 255, 0.075);
    transition-duration: 0.5s;
    cursor: pointer;
}

.w11-sistema-info div {
    margin: auto;
}

.w11-first-container div {
    aspect-ratio: 1;
    border-radius: 0.1rem;
    transition-duration: 0.2s;
    height: 85%;
    display: grid;
    place-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.0);
    cursor: pointer;
}

.w11-second-container div svg {
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    transform: scale(0.7);
}

.w11-first-container div:hover {
    background-color: var(--w11-glass-white-color);
    border-radius: 0.5rem;
    transition-duration: 0.1s;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.w11-first-container div:nth-child(2) svg {
    color: #eff7ff;
}

.w11-first-container div:active>img,
.w11-first-container div:active>svg {
    transform: scale(0.5);
    transition-duration: 0.5s;
}

.w11-first-container img,
.w11-first-container svg {
    transition-duration: 0.5s;
}

/* ========== START MENU STYLES ========== */
.w11-start-section {
    position: fixed !important;
    bottom: calc(var(--w11-nav-height) + 1em) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 100001 !important;
    
    /* Styling */
    color: white;
    backdrop-filter: blur(5em);
    -webkit-backdrop-filter: blur(5em);
    width: 40em;
    max-width: 90vw;
    border-radius: 1em;
    overflow: hidden;
    border: 2px solid var(--w11-glass-white-color);
    background: linear-gradient(rgba(0, 0, 85, 0.075), transparent, rgba(0, 0, 85, 0.192)), rgba(32, 32, 32, .70);
    display: none;
    box-sizing: border-box !important;
}

.w11-start-section.w11-on-visible-start {
    display: block !important;
}

.w11-padding-start:not(.w11-footer-start-section) {
    padding: 0 2em 1em 2em;
}

.w11-input-div-start {
    padding: 2em 2em 0 2em;
}

.w11-cerca-input-start {
    background-color: #1e202c;
    padding: 0 1em;
    box-sizing: border-box;
    color: white;
    width: 100%;
    height: 3em;
    font-size: 1em;
    border-radius: 0.5em;
    border: 1px solid #292b41;
    border-bottom: 2px solid #9dcbe3;
}

.w11-cerca-input-start::placeholder {
    color: #a2a5ae;
}

.w11-app-container-header {
    font-size: 0.95em;
    font-weight: bold;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 1.5em 1em;
    align-items: center;
}

.w11-app-container-header span {
    filter: drop-shadow(0 0 1em white);
}

.w11-second-app-container {
    display: grid;
    gap: 0.5em;
}

.w11-second-app-container div {
    aspect-ratio: 1;
    border-radius: 0.3em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
    cursor: pointer;
    transition-duration: 0.2s;
}

.w11-second-app-container div:hover {
    background-color: var(--w11-glass-white-color);
    transition-duration: 0.1s;
}

.w11-second-app-container img {
    aspect-ratio: 1;
    width: 2.5rem;
    margin: 0.1em;
}

.w11-second-app-container span {
    font-size: 0.7em;
    font-weight: lighter;
    color: white;
    text-align: center;
    text-transform: capitalize;
}

.w11-footer-start-section {
    height: 4em;
    backdrop-filter: blur(10em);
    -webkit-backdrop-filter: blur(10em);
    background-color: rgba(0, 0, 0, 0.514);
    outline: var(--w11-glass-white-color) solid 2px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 4em;
    align-items: center;
}

.w11-nome-utente-start-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em;
    transition-duration: 0.2s;
    cursor: pointer;
}

.w11-nome-utente-start-section:hover {
    background-color: var(--w11-glass-white-color);
    border-radius: 0.5em;
    transition-duration: 0.5s;
}

.w11-nome-utente-start-section svg {
    height: 1.7em;
    width: auto;
    fill: white !important;
}

/* ========== WINBOX CUSTOM STYLING - WINDOWS 11 THEME ========== */
.winbox {
    background: linear-gradient(rgba(0, 0, 85, 0.075), transparent, rgba(0, 0, 85, 0.192)), rgba(32, 32, 32, .85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 1000 !important;
}

/* CRITICAL: Minimized windows must appear above taskbar */
.winbox.min {
    position: fixed !important;
    z-index: 100000 !important;
    height: calc(var(--w11-nav-height) * 0.85) !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: 250px !important;
    border-radius: 0.3rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    bottom: 0.35rem !important;
    transition: all 0.2s ease !important;
}

/* Spacing between minimized windows */
.winbox.min + .winbox.min {
    margin-left: 0.4rem !important;
}

/* First minimized window positioning */
.winbox.min:nth-of-type(1) {
    left: 0.5rem !important;
}

.winbox.min:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Hide controls in minimized state */
.winbox.min .wb-control {
    display: none !important;
}

/* Header styling in minimized state */
.winbox.min .wb-header {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 1rem !important;
}

/* Title styling in minimized state */
.winbox.min .wb-title {
    text-align: center !important;
    width: 100% !important;
    font-size: 12px !important;
    color: #fff !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Hide body in minimized state */
.winbox.min .wb-body {
    display: none !important;
}

/* Hide drag handle border in minimized state */
.winbox.min .wb-drag {
    border: none !important;
}

/* Normal window styling */
.wb-header {
    height: 32px !important;
    background: transparent !important;
}

.wb-body {
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #000 !important;
}

.wb-title {
    font-size: 12px !important;
    color: #fff !important;
    font-weight: 400 !important;
}

.wb-control {
    display: flex !important;
}

.wb-control svg,
.wb-control span {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.wb-control svg:hover,
.wb-control span:hover {
    opacity: 1;
}

.wb-min,
.wb-max,
.wb-full,
.wb-close {
    width: 46px !important;
    height: 32px !important;
}

/* Hide fullscreen button globally */
.wb-full {
    display: none !important;
}

.wb-close:hover {
    background-color: #c42b1c !important;
}

/* Ensure WinBox windows don't interfere with taskbar */
.winbox:not(.min) {
    max-height: calc(100vh - var(--w11-nav-height) - 1rem) !important;
}

