/* Desktop and Background */

#desktop {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    
    /* CDE desktop texture */
    background-image: url('../assets/textures/solaris.jpg');
    background-repeat: repeat;
    background-color: #5c6c7c;
}

.desktop-scale {
    width: 100%;
    height: calc(100% - 70px); /* Account for panel height */
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    transform: scale(var(--cde-scale));
}

/* Desktop Panel / Taskbar */
#desktop-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scale(var(--cde-scale));
    transform-origin: bottom center;
    width: auto;
    max-width: 95%;
    height: 65px;
    background: #abb0bf;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2px;
    gap: 0;
    z-index: 10000;
    
    /* Raised border - light on top/left, dark on bottom/right */
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #6f727d;
    box-shadow: 
        -1px 0 2px rgba(0, 0, 0, 0.15),
        1px 0 2px rgba(0, 0, 0, 0.15);
}

/* Side handle boxes */
.panel-handle {
    width: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.panel-handle-top {
    height: 20%;
    background: #abb0bf;
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #6f727d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #4c5058;
}

.panel-handle-bottom {
    flex: 1;
    background: #abb0bf;
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #6f727d;
    position: relative;
    overflow: hidden;
}

.panel-handle-texture {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        #7c7c84 0px, #8c8c94 1px, #8c8c94 2px,
        transparent 2px, transparent 3px);
    background-size: 3px 100%;
}

.panel-section {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 0;
    height: 100%;
}

.panel-left {
    flex: 0 0 auto;
}

.panel-center {
    width: 25%;
    min-width: 200px;
    height: 100%;
    background: #abb0bf;
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #6f727d;
    padding: 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-center-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 170px;
    padding: 24px 24px 24px 24px;
}

.panel-center-icon {
    position: absolute;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.panel-center-icon img {
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
}

.panel-center-icon.lock {
    top: 2px;
    left: 2px;
}

.panel-center-icon.earth {
    top: 2px;
    right: 2px;
}

.panel-center-icon.exit {
    bottom: 2px;
    right: 2px;
}

.panel-right {
    flex: 0 0 auto;
}

.panel-button {
    width: 44px;
    height: 100%;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
    border: none;
}

.panel-button-arrow {
    height: 20%;
    background: #abb0bf;
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #6f727d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #4c5058;
}

.panel-button-content {
    flex: 1;
    background: #abb0bf;
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #6f727d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px;
}

.panel-button:active .panel-button-arrow,
.panel-button:active .panel-button-content {
    /* Invert borders when active */
    border-top: 1px solid #6f727d;
    border-left: 1px solid #6f727d;
    border-bottom: 1px solid #d4d6dc;
    border-right: 1px solid #d4d6dc;
}

.panel-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
}

.panel-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
}

.panel-label {
    font-family: 'Terminus', 'Helvetica', 'Arial', sans-serif;
    font-size: 9px;
    text-align: center;
    line-height: 1.1;
    font-weight: normal;
}

.panel-calendar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: black;
    font-weight: bold;
    text-shadow: none;
    pointer-events: none;
}

.panel-label-small {
    font-family: 'Terminus', 'Helvetica', 'Arial', sans-serif;
    font-size: 8px;
    text-align: center;
    font-weight: normal;
}

.panel-workspace {
    background: #63629b;
    border-top: 1px solid #8c8cc4;
    border-left: 1px solid #8c8cc4;
    border-bottom: 1px solid #3c3c60;
    border-right: 1px solid #3c3c60;
    width: 100%;
    height: 100%;
    padding: 2px 8px;
    margin: 0;
    cursor: pointer;
    font-family: 'Terminus', 'Helvetica', 'Arial', sans-serif;
    font-size: 11px;
    font-weight: normal;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.panel-workspace.active,
.panel-workspace:active {
    /* Invert borders when active */
    border-top: 1px solid #3c3c60;
    border-left: 1px solid #3c3c60;
    border-bottom: 1px solid #8c8cc4;
    border-right: 1px solid #8c8cc4;
}

.exit-button {
    width: 55px;
    height: 100%;
    background: #abb0bf;
    border-top: 1px solid #d4d6dc;
    border-left: 1px solid #d4d6dc;
    border-bottom: 1px solid #6f727d;
    border-right: 1px solid #d4d6dc;
    color: var(--cde-text);
    font-weight: bold;
    font-size: 11px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exit-button:active {
    border-top: 1px solid #6f727d;
    border-left: 1px solid #6f727d;
    border-bottom: 1px solid #d4d6dc;
    border-right: 1px solid #d4d6dc;
}

/* Mobile Warning */
#mobile-warning {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.warning-dialog {
    width: 80%;
    max-width: 400px;
    min-height: auto !important;
    box-shadow: 10px 10px 20px rgba(0,0,0,0.5);
}

/* Show only on screens smaller than 768px */
@media screen and (max-width: 768px) {
    #mobile-warning {
        display: flex;
    }
}