/* mobile.css - Responsive Smartphone OS Layout (< 768px) */

@media (max-width: 767px) {
    html, body {
        overflow: hidden !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
    }

    .desktop, .taskbar, #start-menu, #context-menu, #desktop-donates-widget {
        display: none !important;
    }
    
    #matrix-bg {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 1 !important;
        opacity: 0.28 !important;
        pointer-events: none !important;
    }

    .mobile-app {
        display: flex !important;
        flex-direction: column;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100% !important;
        overflow: hidden !important;
        padding: 8px 10px max(6px, env(safe-area-inset-bottom, 6px)) 10px;
        box-sizing: border-box;
        background: transparent !important;
        color: var(--light-gray);
        font-family: var(--font-mono);
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
    }
}

@media (min-width: 768px) {
    .mobile-app {
        display: none !important;
    }
}

/* ========================================================
   1. MOBILE HEADER (Sticky / Fixed look)
   ======================================================== */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 4px 8px 4px;
    border-bottom: 1px solid var(--win-border-subtle);
    margin-bottom: 8px;
    flex-shrink: 0;
    background: rgba(5, 6, 13, 0.92);
    backdrop-filter: blur(8px);
    z-index: 5;
    border-radius: 4px;
}

.mobile-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mobile-logo {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    border: 1.5px solid var(--bright-blue);
    box-shadow: 0 0 10px rgba(4, 169, 240, 0.45);
    flex-shrink: 0;
}

.mobile-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bright-blue);
    line-height: 1.15;
    letter-spacing: 0.5px;
}

.mobile-subtitle {
    font-size: 10.5px;
    color: var(--light-gray);
}

/* Header message rate widget: "só números" */
.mobile-header-rate {
    display: flex;
    align-items: baseline;
    gap: 4px;
    background: rgba(4, 169, 240, 0.15);
    border: 1px solid rgba(4, 169, 240, 0.45);
    border-radius: 6px;
    padding: 5px 10px;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(4, 169, 240, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}

.mobile-header-rate:hover, .mobile-header-rate:active {
    border-color: var(--cyan-neon);
    background: rgba(4, 169, 240, 0.25);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

.mobile-rate-number {
    font-family: var(--font-mono);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--cyan-neon);
    letter-spacing: 0.5px;
}

.mobile-rate-unit {
    font-size: 10px;
    color: var(--light-gray);
    font-weight: 500;
}

/* ========================================================
   2. SERVICE PILLS BAR
   ======================================================== */
.mobile-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    flex-shrink: 0;
    background: rgba(5, 6, 13, 0.88);
    backdrop-filter: blur(6px);
    padding: 4px 6px;
    border-radius: 8px;
    z-index: 5;
}

.mobile-service-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: #110d29;
    border: 1px solid var(--win-border-subtle);
    border-radius: 12px;
    font-size: 10.5px;
    color: #ffffff;
    white-space: nowrap;
}

.mobile-service-pill .service-status-dot {
    margin-right: 0;
    width: 8px;
    height: 8px;
}

/* ========================================================
   3. MIDDLE CONTENT AREA (Flex container)
   ======================================================== */
.mobile-content-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* Home Screen: Spaced out so donations stays at the bottom */
.mobile-home {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 2px 8px 2px;
    transition: opacity 0.2s ease;
}

/* App Grid: 4 icons per row (Enlarged for mobile) */
.mobile-app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 6px;
    padding: 6px 0;
    flex-shrink: 0;
}

.mobile-app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 2px;
    background: transparent;
    border: none;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.mobile-app-icon:active {
    transform: scale(0.92);
}

.mobile-app-img-wrap {
    width: 58px;
    height: 58px;
    border-radius: 15px; /* Smartphone app squircle */
    background: linear-gradient(180deg, #271556 0%, #130c33 100%);
    border: 1.5px solid rgba(4, 169, 240, 0.45);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(4, 169, 240, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-app-icon:active .mobile-app-img-wrap {
    border-color: var(--cyan-neon);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
}

.mobile-app-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mobile-app-img-wrap i {
    font-size: 26px;
    color: var(--bright-blue);
}

.mobile-app-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* Recent Donations Card (Home Screen - Anchored near bottom) */
.mobile-donations-card {
    background: linear-gradient(180deg, rgba(24, 18, 54, 0.94) 0%, rgba(16, 11, 38, 0.96) 100%);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255, 215, 0, 0.45);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: auto;
    margin-bottom: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 215, 0, 0.15);
    cursor: pointer;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.mobile-donations-card:hover {
    border-color: var(--gold-color);
}

.mobile-donations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mobile-donations-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-color);
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Heartbeat Pulse Animation for Donate Button */
@keyframes donateHeartbeat {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 64, 129, 0.4);
    }
    14% {
        transform: scale(1.14);
        box-shadow: 0 4px 14px rgba(255, 64, 129, 0.8), 0 0 10px rgba(255, 64, 129, 0.6);
    }
    28% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 64, 129, 0.4);
    }
    42% {
        transform: scale(1.14);
        box-shadow: 0 4px 14px rgba(255, 64, 129, 0.8), 0 0 10px rgba(255, 64, 129, 0.6);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 64, 129, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 64, 129, 0.4);
    }
}

.mobile-donate-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    background: linear-gradient(180deg, #ff4081 0%, #c2185b 100%);
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #ff80ab;
    box-shadow: 0 2px 8px rgba(255, 64, 129, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: donateHeartbeat 1.6s infinite ease-in-out;
    transform-origin: center;
}

.mobile-donations-meta {
    font-size: 11px;
    color: #ffeb3b;
    margin-bottom: 8px;
    background: rgba(255, 215, 0, 0.12);
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.mobile-donors-mini-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 85px;
    overflow-y: auto;
}

.mobile-donor-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #e0e0ee;
    padding: 3px 0;
}

/* ========================================================
   4. APP SCREEN (Desktop Window Aesthetic - NO PAGE SCROLL)
   ======================================================== */
.mobile-app-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 6px;
    animation: mobileSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mobile-app-view.sliding-down {
    animation: mobileSlideDown 0.22s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes mobileSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mobileSlideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(24px);
    }
}

.mobile-app.app-active .mobile-services {
    display: none !important;
}

.mobile-app.app-active .mobile-header {
    padding: 2px 4px !important;
    margin-bottom: 4px !important;
}

.mobile-window-card {
    background: linear-gradient(180deg, rgba(35, 6, 109, 0.96) 0%, rgba(13, 9, 34, 0.98) 100%);
    backdrop-filter: blur(8px);
    border: 2px solid var(--bright-blue);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(4, 169, 240, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
}

.mobile-window-header {
    height: 38px;
    background: linear-gradient(180deg, #37118f 0%, #1c0558 100%);
    border-bottom: 1px solid var(--bright-blue);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    user-select: none;
}

.mobile-window-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.mobile-window-icon {
    font-size: 14px;
    color: var(--cyan-neon);
    flex-shrink: 0;
}

.mobile-window-title {
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-window-close-btn {
    width: 28px;
    height: 28px;
    background: rgba(229, 62, 62, 0.25);
    border: 1px solid rgba(229, 62, 62, 0.5);
    border-radius: 5px;
    color: #ff6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    z-index: 10;
}

.mobile-window-close-btn:active {
    background: #e53e3e;
    color: #ffffff;
    transform: scale(0.92);
}

/* ONLY THIS CONTAINER SCROLLS ITS CONTENT IN APP VIEW! */
.mobile-window-body {
    padding: 10px;
    overflow-y: auto !important;
    overflow-x: auto;
    flex: 1 1 0;
    min-height: 0;
    font-size: 12px;
    color: #e0e0ee;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pan-x;
    overscroll-behavior-y: contain;
}

/* Close App Button with safe-area spacing */
.mobile-home-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    margin-top: 2px;
    flex-shrink: 0;
    padding-bottom: max(4px, env(safe-area-inset-bottom, 4px));
}

.mobile-home-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 22px;
    background: linear-gradient(180deg, #2a1458 0%, #150b36 100%);
    border: 2px solid var(--bright-blue);
    border-radius: 19px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 14px rgba(4, 169, 240, 0.45);
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-home-fab i {
    font-size: 14px;
    color: var(--cyan-neon);
}

.mobile-home-fab:active {
    transform: scale(0.95);
    border-color: var(--cyan-neon);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.6);
}

/* ========================================================
   5. RESPONSIVE ADAPTATIONS FOR APPS INSIDE MOBILE WINDOW
   ======================================================== */
.mobile-window-body .meu-computador .drive-list {
    grid-template-columns: 1fr !important;
}

.mobile-window-body .drive-item {
    width: 100% !important;
}

.mobile-window-body .stats-window {
    min-width: 0 !important;
    width: 100% !important;
}

.mobile-window-body .stats-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
    width: 100% !important;
    margin-bottom: 8px !important;
}

.mobile-window-body .stats-table {
    min-width: 520px !important;
    font-size: 10.5px !important;
}

.mobile-window-body .stats-table th,
.mobile-window-body .stats-table td {
    padding: 5px 6px !important;
    white-space: nowrap !important;
}

.mobile-window-body .stats-charts-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
}

.mobile-window-body .chart-box {
    padding: 8px !important;
    min-height: unset !important;
    touch-action: pan-y !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.mobile-window-body .chart-container-inner,
.mobile-window-body .highcharts-container,
.mobile-window-body .highcharts-root {
    touch-action: pan-y !important;
    max-width: 100% !important;
}

.mobile-window-body .community-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
}

.mobile-window-body .speedometer-view {
    padding: 10px 0;
}

.mobile-window-body .speedometer-view canvas {
    max-width: 100%;
    height: auto;
}

.mobile-window-body .explorer-table {
    font-size: 11px;
}

.mobile-window-body .explorer-table th,
.mobile-window-body .explorer-table td {
    padding: 6px 8px;
}

.mobile-window-body input,
.mobile-window-body textarea,
.mobile-window-body select {
    font-size: 12.5px !important;
}

/* ========================================================
   WAIFULETES MOBILE OPTIMIZATIONS
   ======================================================== */
.mobile-window-body .waifu-redirect-container {
    height: 100%;
    min-height: 100%;
    padding: 20px 14px;
    justify-content: flex-start;
    gap: 14px;
}

.mobile-window-body .waifu-redirect-title {
    font-size: 15px;
}

.mobile-window-body .waifu-redirect-card {
    padding: 14px 14px;
}

.mobile-window-body .waifu-redirect-text {
    font-size: 12px;
}

.mobile-window-body .waifu-redirect-url-link {
    font-size: 11.5px;
    padding: 7px 14px;
}

.mobile-window-body .waifu-window-container {
    height: auto;
    min-height: 100%;
}

.mobile-window-body .waifu-grid-wrapper {
    flex: unset;
    min-height: 380px;
}

.mobile-window-body .waifu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

.mobile-window-body .waifu-card-name {
    font-size: 11px !important;
}

.mobile-window-body .waifu-filters-row {
    gap: 8px !important;
}

.mobile-window-body .waifu-pill-group {
    flex-wrap: wrap;
}

.mobile-window-body .waifu-pagination-bar {
    padding: 6px 8px !important;
    gap: 6px !important;
}

.mobile-window-body .waifu-toast {
    bottom: 35px !important;
    max-width: 92% !important;
    font-size: 11px !important;
    padding: 7px 12px !important;
}

.mobile-window-body .waifu-married-badge {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
}

.mobile-window-body .waifu-wishes-badge {
    font-size: 9.5px !important;
    padding: 1px 4px !important;
}

/* Commands App Mobile View */
.mobile-window-body.commands-body {
    padding: 0 !important;
    overflow: hidden !important;
}

