/* Explain: Styles for console-like UI components with PS4 aesthetic. */
/* ============================================
   Console UI — Clean, Modern Glassmorphism
   ============================================ */

/* Full-screen dim behind modal panels */
.console-backdrop {
    transform: translateZ(0);
    backface-visibility: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(10, 15, 30, 0.6), rgba(2, 4, 10, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes panelSlideUp {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Main panel */
.console-panel {
    position: relative;
    animation: panelSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateZ(0);
    backface-visibility: hidden;
    background: rgba(18, 24, 38, 0.65);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Section heading bar */
.console-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.console-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #f8fafc;
}

/* Buttons */
.console-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-size: 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.console-btn:hover,
.console-btn:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}
.console-btn-primary {
    background: var(--primary-color);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 55, 145, 0.3);
}
.console-btn-primary:hover,
.console-btn-primary:focus-visible {
    background: var(--primary-hover);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 55, 145, 0.4);
    transform: translateY(-1px);
}
.console-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    box-shadow: none;
}
.console-btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.console-btn-danger {
    background: rgba(220, 38, 38, 0.85);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}
.console-btn-danger:hover,
.console-btn-danger:focus-visible {
    background: rgba(239, 68, 68, 1);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

/* Inputs */
.console-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    padding: 1rem 1.25rem;
    color: #f8fafc;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}
.console-input::placeholder {
    color: rgba(156, 163, 175, 0.6);
}
.console-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 112, 204, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

/* Selectable setting rows */
.console-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}
.console-row-active {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 112, 204, 0.15);
}

/* Selection tiles (icon/style pickers, toggles) */
.console-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    cursor: pointer;
}
.console-tile:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.console-tile.console-tile-active {
    border-color: transparent;
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 55, 145, 0.3);
}

/* Round close button */
.console-close {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    cursor: pointer;
}
.console-close:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@keyframes ps4-notification-in {
    0% { transform: translateX(-120%); opacity: 0; }
    10% { transform: translateX(0); opacity: 1; }
    85% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-120%); opacity: 0; }
}

/* Horizontal scroll arrows */
.console-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.console-arrow:hover,
.console-arrow:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ============================================
   Smooth view / element transitions
   ============================================ */
@keyframes consoleViewIn {
    from { opacity: 0; scale: 0.99; }
    to { opacity: 1; scale: 1; }
}
.console-view {
    animation: consoleViewIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes consoleRise {
    from { opacity: 0; translate: 0 10px; }
    to { opacity: 1; translate: 0 0; }
}
.console-rise {
    animation: consoleRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes consoleBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.console-backdrop {
    animation: consoleBackdropIn 0.3s ease-out backwards;
}

[data-tile-id] {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.4s ease;
}

/* Thin animated loading bar */
.console-loader {
    position: relative;
    width: 12rem;
    height: 3px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
}
.console-loader::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: consoleLoader 1.2s ease-in-out infinite;
}
@keyframes consoleLoader {
    from { left: -40%; }
    to { left: 100%; }
}

/* ============================================
   Console popup details (button prompts, labels)
   ============================================ */
.console-hintbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1.25rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.02em;
}
.console-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.console-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.console-glyph-cross { color: #93c5fd; }
.console-glyph-circle { color: #fca5a5; }

.console-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.console-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: #93c5fd;
}

/* Small pill button ("Show all on this page") */
.console-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-height: 2.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 20, 30, 0.6);
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    cursor: pointer;
}
.console-chip:hover,
.console-chip:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.console-chip.console-chip-active {
    border-color: transparent;
    background: var(--primary-color);
    color: #fff;
}

/* ============================================
   Clean store
   ============================================ */
.store-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.store-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
}
.store-tab:hover { color: #fff; }
.store-tab.store-tab-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.store-card {
    cursor: pointer;
}
.store-card-media {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
.store-card:hover .store-card-media,
.store-card.store-card-focus .store-card-media {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
}
.store-card.store-card-focus .store-card-media {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
}

/* White Mars logo mark (spins continuously) */
@keyframes marsSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.mars-logo {
    color: #ffffff;
    transform-origin: center;
    animation: marsSpin 12s linear infinite;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .console-view,
    .console-rise,
    .console-backdrop,
    .console-panel,
    .mars-logo {
        animation: none !important;
    }
}