:root {
    --bs-body-font-family: 'Roboto Mono', monospace;
    --desktop-icon-bg-hover: rgba(255, 255, 255, 0.65);
    --taskbar-hover-bg: rgba(255, 255, 255, 0.15);
    --window-header-bg: rgba(0, 0, 0, 0.85);
    --animate-duration: 500ms;
    --animate-delay: 0.2s;
}

* {
    font-family: var(--bs-body-font-family);
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Wallpaper */
#wallpaper {
    position: fixed;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center;
    background-attachment: fixed;
    z-index: -99;
}

#wallpaper-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    z-index: -99;
}

/* Desktop icons */
#desktopiconrow .app {
    transition: all 0.2s ease;
    cursor: pointer;
}

#desktopiconrow .app:hover {
    background-color: var(--desktop-icon-bg-hover);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Taskbar */
#menubar {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    height: 48px;
}

#start:hover, #clock:hover, #menubar > div:not(.ui-state-disabled):hover {
    background-color: var(--taskbar-hover-bg);
}

/* Application windows */
.moveablediv {
    display: block;
    position: absolute;
    left: 150px;
    top: 50px;
    z-index: 1000;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 8px;
    overflow: hidden; /* This hides any content that spills outside the rounded corners */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 800px;
    height: auto;
    max-height: 100vh; /* Maximum height is viewport height */
}

.moveableheaderdiv {
    background-color: var(--window-header-bg);
    color: #fff;
    cursor: move;
    user-select: none;
}

#content {
    width: 100%;
    height: calc(90% - 40px); /* Adjust this based on your header height */
    max-height: calc(90vh - 100px); /* Slightly less than viewport to ensure scrollability */
    overflow-y: auto; /* Vertical scrolling only */
}

#content > iframe {
    border-radius: 20px;
    min-height: 600px;
}

.closebutton {
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.closebutton:hover {
    opacity: 1;
}

.helpbutton {
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.helpbutton:hover {
    opacity: 1;
}

/* Start menu */
#startMenu .modal-content {
    border-radius: 12px;
}

#apps-grid .app {
    transition: all 0.2s;
    text-align: left;
}

#apps-grid .app:hover {
    background-color: #f0f0f0;
    transform: translateX(4px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #desktopiconrow {
        row-gap: 1rem;
    }

    .moveablediv {
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: calc(100% - 48px) !important;
        max-height: unset !important;
    }

    #content {
        width: 100% !important;
        max-height: unset !important;
        height: calc(100% - 40px - 1rem) !important;
    }
}

@media (max-width: 576px) {
    #clockModal .row {
        flex-direction: column;
    }

    #clockModal .col-md-5,
    #clockModal .col-md-7 {
        width: 100%;
    }
}

/* FullCalendar adjustments */
.fc-daygrid-day-events {
    display: none;
}

.fc-daygrid-day-number,
.fc-col-header-cell-cushion {
    color: inherit;
    text-decoration: none;
}

.fc .fc-daygrid-day-frame {
    min-height: 3em;
}

.achievement-icon {
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.achievement-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Locked Achievement Style */
.achievement-locked {
    position: relative;
    opacity: 0.5;
    filter: grayscale(70%);
}


/* For mobile responsiveness */
@media (max-width: 768px) {
    .achievements-container .row {
        row-cols: 4 !important;
    }
}

.ajs-bamuel-custom {
    color: #000 !important;
    background-color: #fff !important;
    border-color: #000 !important;
    border-radius: 8px !important;
    text-align: left !important;
}

.alertify-notifier.ajs-bottom {
    bottom: 60px !important;
}

.alertify-notifier.ajs-right .ajs-message.ajs-visible {
    right: 260px !important;
}
