/* =========================
   OVERLAY
========================= */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 900;
    /* below drawer (1000) */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================
   DRAWER
========================= */

.drawer {
    position: fixed;
    bottom: calc(-100% + 70px);
    left: 0;
    width: 100%;
    max-height: 85%;

    background: var(--card);
    color: var(--text);

    border-top-left-radius: 20px;
    border-top-right-radius: 20px;

    overflow: hidden;

    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);

    transform: translateY(20px) scale(0.98);
    opacity: 0;

    transition:
        bottom 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.3s ease,
        opacity 0.25s ease;

    z-index: 1000;

    display: flex;
    flex-direction: column;

    touch-action: none;
}

.drawer.active {
    bottom: calc(70px + env(safe-area-inset-bottom));
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Drawer Header */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;

    border-bottom: 1px solid var(--border);

    position: sticky;
    top: 0;

    background: var(--card);
}

.drawer-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.close-btn {
    font-size: 26px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
}

/* Drawer Content */
.drawer-content {
    padding: 20px;
    overflow-y: auto;
}


/* =========================
   APP GRID
========================= */

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* App Tile */
.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 16px 10px;
    border-radius: 14px;

    background: var(--card);
    color: var(--text);

    box-shadow: 0 4px 10px var(--shadow);
    text-decoration: none;

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px var(--shadow);
}

/* App Icon */
.app-icon {
    font-size: 22px;
}

/* App Label */
.app-label {
    font-size: 13px;
    font-weight: 500;
}

/* =========================
   TRANSITIONS
========================= */

.navbar,
.drawer,
.profile-menu,
.app,
.drawer-header,
.profile-menu a {
    transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}