/* MacHTML - Apple Style Redesign */

:root {
    --bg-color: #000000;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-blue: #2997ff;
    --accent-purple: #bf5af2;
    --glass-bg: rgba(22, 22, 23, 0.82);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-height: 48px;
}

html,
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.hero-title {
    font-size: 56px;
    line-height: 1.07143;
    font-weight: 700;
    letter-spacing: -0.005em;
    background: linear-gradient(180deg, #fff 0%, #bca1f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 80px;
    }
}

.animate-fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-in-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.animate-scale-up {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale-up.in-view {
    opacity: 1;
    transform: scale(1);
}

/* Hero Image Blending */
.hero-image-mask {
    /* Use a more aggressive gradient to ensure edges are fully transparent */
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    /* Ensure the mask covers the entire element properly */
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.text-gradient {
    background: linear-gradient(135deg, #2997ff 0%, #bf5af2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.95);
        filter: blur(100px);
    }

    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.05);
        filter: blur(120px);
    }
}

.pulse-animation {
    animation: pulse-glow 4s infinite ease-in-out;
}

/* Components */
.apple-button {
    background: #0071e3;
    color: #fff;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 17px;
    transition: all 0.3s cubic-bezier(0, 0, 0.5, 1);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.apple-button:hover {
    background: #0077ed;
    transform: scale(1.02);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bento-item.large {
        grid-column: span 2;
    }

    .bento-item.full {
        grid-column: span 3;
    }
}

.bento-item {
    background: #161617;
    border-radius: 30px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid #333;
}

/* Apple Style Navigation */
.nav-link {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s ease;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    opacity: 0.5;
    font-size: 14px;
}

/* Mobile Navigation Links (Apple Style) */
.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-size: 20px;
    font-weight: 600;
    color: #f5f5f7;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.2s ease;
}

.mobile-nav-link:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    color: #2997ff;
}

.mobile-nav-link i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.mobile-nav-link:hover i {
    transform: translateX(4px);
}

/* Mobile Menu Overlay (Apple Official Style) */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 99999;
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.42, 0, 0.58, 1);
}

.mobile-menu-overlay.active {
    display: block;
    transform: translateY(0);
}

.mobile-menu-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0 48px;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0;
    opacity: 0;
    transform: translateY(-10px);
    animation: mobile-item-fade-in 0.35s ease forwards;
    animation-delay: 0.1s;
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mobile-menu-close:hover {
    color: #fff;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-menu-item {
    display: block;
    padding: 18px 0;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    transform: translateY(-8px);
    animation: mobile-item-fade-in 0.35s ease forwards;
    animation-delay: calc(0.15s + var(--item-index, 0) * 0.05s);
    transition: color 0.15s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    color: rgba(255, 255, 255, 0.56);
}

@keyframes mobile-item-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.glass-header {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    transition: all 0.4s ease;
}

.glass-header.scrolled {
    background: rgba(22, 22, 23, 0.82);
    backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Apple Style Utilities */
.bg-apple-card {
    background: #161617;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-apple-blue {
    color: #0071e3;
}

.text-apple-sub {
    color: #86868b;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 980px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.action-pill-primary {
    background: #0071e3;
    color: white;
}

.action-pill-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-fade-in {
    animation: fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scale-up {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-up {
    animation: scale-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Mobile Adaptations (Precision Tuning) --- */
@media (max-width: 1024px) {
    #console-main-content {
        flex-direction: column !important;
        gap: 2rem !important;
    }

    aside {
        width: 100% !important;
        order: 2;
    }

    .flex-1.space-y-8 {
        order: 1;
    }
}

@media (max-width: 768px) {
    .max-w-\[1280px\] {
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 1.5rem !important;
    }

    .glass-island {
        border-radius: 20px !important;
        padding: 16px !important;
    }

    /* Instance Spotlight Header */
    #order-title {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        display: block !important;
        /* Force status to next line on small screens */
    }

    #order-status {
        display: inline-flex !important;
        white-space: nowrap !important;
        flex-shrink: 0;
        margin-bottom: 12px;
    }

    /* Metadata adjustment */
    .flex.items-center.gap-3.text-apple-sub {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        font-size: 11px !important;
    }

    /* Hide the pipes in injected HTML */
    #order-uuid span.opacity-20 {
        display: none !important;
    }

    /* Action Buttons Mobile */
    .flex.items-center.gap-4 {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #vnc-button {
        width: 100% !important;
        height: 48px !important;
    }

    .control-group {
        display: flex !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        padding: 4px !important;
        border-radius: 16px !important;
    }

    .control-button {
        flex: 1;
        height: 48px !important;
    }

    /* Hardware Specs List */
    .spec-label {
        font-size: 13px !important;
    }

    .spec-value {
        font-size: 13px !important;
        text-align: right !important;
        max-width: 65%;
        word-break: break-all;
    }

    /* Hide decorative hardware image */
    .absolute.right-\[-40px\].top-\[-20px\],
    .group-hover\:scale-110 {
        display: none !important;
    }
}

@media (max-width: 480px) {
    #order-title {
        font-size: 1.1rem !important;
    }

    .max-w-\[1280px\] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .glass-island {
        padding: 14px !important;
    }
}