/* Styles for Home Screen, Dock, and Pagination */
#home-screen {
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

#app-grid-container {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.45, 0, 0.55, 1);
}

.page {
    width: 50%;
    flex-shrink: 0;
}

#app-grid, #app-grid-2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
    padding-top: 50px;
    box-sizing: border-box;
}

#pagination-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 20px;
    position: absolute;
    bottom: 110px; /* Position above the dock */
    width: 100%;
    z-index: 4;
}

#pagination-dots.hidden {
    display: none;
}

#pagination-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.3s, transform 0.3s;
    cursor: pointer;
}

#pagination-dots .dot.active {
    background-color: white;
    transform: scale(1.1);
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: white;
    font-size: 12px;
}

.app-icon img {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.app-icon:active img {
    transform: scale(0.9);
}

.app-icon span {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.home-timer {
    /* make the embedded shutdown timer larger and more prominent */
    font-size: 15px; /* increased from 13px */
    min-width: 150px; /* increased width to better fit larger text */
    padding: 8px 14px; /* larger padding */
    top: 14px; /* slight vertical adjustment */
    left: 92px;
}

/* App Context Menu */
#app-context-menu {
    position: absolute;
    z-index: 50;
    width: 260px;
    background-color: rgba(40, 40, 40, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 14px;
    overflow: hidden;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: opacity 0.1s ease, transform 0.1s ease;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

#app-context-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.context-menu-group {
    margin: 6px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes icon to the right */
    width: 100%;
    padding: 12px 16px;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.context-menu-item:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.context-menu-item.context-menu-destructive {
    color: #ff453a;
}

.context-menu-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.context-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
    opacity: 0.9;
}

/* Dock Styles */
#dock {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 90px;
    z-index: 5;
    padding: 0 10px;
    transition: transform 0.35s cubic-bezier(0.45, 0, 0.55, 1);
    transform: translateY(120%); /* Hide by default */
}

#dock.visible {
    transform: translateY(0); /* Make visible */
}

#dock-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    position: relative;
    z-index: 2;
}

.dock-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--glass-bg-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 28px;
    border: 1px solid var(--glass-border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1;
    overflow: hidden;
}

.dock-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 180, 230, 0.1) 20%,
        rgba(180, 220, 255, 0.1) 40%,
        rgba(200, 255, 200, 0.1) 60%,
        rgba(255, 220, 180, 0.1) 80%,
        rgba(255, 255, 255, 0.2) 100%
    );
    background-size: 200% 200%;
    animation: var(--liquid-animation);
    z-index: -1;
}

#screen.broken-state .dock-background {
    background-color: rgba(50, 0, 0, 0.6); /* Corrupted dark red/black glass */
    backdrop-filter: blur(10px) saturate(2);
    -webkit-backdrop-filter: blur(10px) saturate(2);
    border: 2px dashed #ff453a;
    box-shadow: 0 0 20px 5px rgba(255, 0, 0, 0.5);
    animation: dock-glitch 0.3s infinite alternate;
}

@keyframes dock-glitch {
    0% { transform: skewX(0.5deg); }
    100% { transform: skewX(-0.5deg); }
}