/* Star Wars Datapad Rebuild - Launcher & Frame Styling */
/* Exclusively using local fonts from datapad_app/assets/font/ */
@font-face {
    font-family: "MorrisSansCondensedMedium";
    src: url('../assets/font/MorrisSansCondensedMedium.ttf') format("truetype");
}

@font-face {
    font-family: "MorrisSansCondensedLight";
    src: url('../assets/font/MorrisSansCondensedLight.ttf') format("truetype");
}

@font-face {
    font-family: "Aurebesh";
    src: url('../assets/font/AurebeshNeue.ttf') format("truetype");
}

@font-face {
    font-family: "Droidobesh";
    src: url('../assets/font/DroidobeshNeueBeta.ttf') format("truetype");
}

@font-face {
    font-family: "ModeNine";
    src: url('../assets/font/ModeNine.ttf') format("truetype");
}

@font-face {
    font-family: "Akashi";
    src: url('../assets/font/Akashi.ttf') format("truetype");
}

:root {
    --sw-cyan: #00e5ff;
    --sw-cyan-dim: rgba(0, 229, 255, 0.2);
    --sw-amber: #ff9d00;
    --sw-amber-dim: rgba(255, 157, 0, 0.2);
    --sw-red: #ff3344;
    --sw-bg: #06090e;
    --sw-panel-bg: rgba(10, 16, 26, 0.94);
    --sw-border: #1a2c42;
    --sw-font-tech: 'MorrisSansCondensedLight', 'MorrisSansCondensedMedium', sans-serif;
    --sw-font-title: 'MorrisSansCondensedMedium', 'MorrisSansCondensedLight', sans-serif;
    --sw-font-aurebesh: 'Aurebesh', sans-serif;
    --sw-font-mono: 'ModeNine', monospace;
}

body.datapad-body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at center, #181818 0%, #050505 100%);
    font-family: var(--sw-font-tech);
    color: #d0d0d0;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Datapad Device Shell (Desktop Emulation) --- */
#datapad-phone-frame {
    position: relative;
    width: 440px;
    height: 94vh;
    max-height: 920px;
    background: #121212;
    border-radius: 40px;
    box-shadow: 
        0 0 0 4px #2c2c2c,
        0 0 0 8px #080808,
        0 0 30px rgba(0, 0, 0, 0.8),
        0 25px 50px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
    border: 3px solid #222222;
}

#datapad-phone-frame.fullscreen-mode {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Device Top Bezel / Sensor Notch */
.datapad-top-notch {
    height: 28px;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #888888;
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', var(--sw-font-tech), sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid #1f1f1f;
    z-index: 10;
}

.datapad-top-notch .status-led {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff2a2a;
    box-shadow: 0 0 6px #ff2a2a, 0 0 10px rgba(255, 42, 42, 0.6);
    animation: blinkLedRed 1.8s infinite;
}

@keyframes blinkLedRed {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.15; transform: scale(0.9); }
}

/* Game Canvas Host inside Phone Frame */
#game-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

#game {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

#game canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#three_render_target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* --- Datapad In-App Hamburger Menu (Decommission Bypass Dialog) --- */
#datapad-hamburger-menu {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100%;
    height: calc(100% - 28px);
    background: rgba(0, 0, 0, 0.65);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

#datapad-hamburger-menu.open {
    display: flex;
}

/* Authentic BaseSWGEDialog Box */
.sw-menu-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #000000;
    border: 1px solid #FFA000;
    box-shadow: 0 0 0 1px #000000, 0 14px 32px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.swgs-theme .sw-menu-card,
.sw-menu-card.swgs-theme {
    border-color: #E5A823;
}

/* Native Title Box (Solid header bar with pure black text) */
.sw-menu-header {
    background: #FFA000;
    height: 42px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    flex-shrink: 0;
}

.swgs-theme .sw-menu-header {
    background: #E5A823;
}

.sw-menu-title {
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #000000;
    text-transform: uppercase;
}

.sw-menu-close-btn {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    font-family: 'MorrisSansCondensedMedium', sans-serif;
    transition: transform 0.1s ease;
}

.sw-menu-close-btn:hover {
    transform: scale(1.2);
}

/* Slicer Indicator Banner */
.sw-slicer-banner {
    background: #0d0802;
    border-bottom: 1px solid rgba(255, 160, 0, 0.35);
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    flex-shrink: 0;
}

.sw-slicer-tag {
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #FFA000;
    text-transform: uppercase;
}

.sw-slicer-aurebesh {
    font-family: 'Aurebesh', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    color: #FFB838;
}

/* Menu Content & Buttons */
.sw-menu-content {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #000000;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    box-sizing: border-box;
}

.sw-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #FFA000;
    margin-top: 4px;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
}

.sw-section-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 160, 0, 0.35);
}

/* Authentic GraphicButton Styles (Single chamfered corner, inverts on hover/active) */
.sw-graphic-btn {
    position: relative;
    background: #000000;
    border: 1px solid #FFA000;
    color: #FFA000;
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 10px 8px;
    cursor: pointer;
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.12s ease, color 0.12s ease;
    user-select: none;
    line-height: 1.15;
}

.sw-graphic-btn.full-width {
    width: 100%;
}

.sw-graphic-btn:hover {
    background: #FFA000;
    color: #000000;
}

.sw-graphic-btn.active {
    background: #FFA000;
    color: #000000;
}

.sw-graphic-btn.danger {
    border-color: #FF3344;
    color: #FF3344;
}

.sw-graphic-btn.danger:hover {
    background: #FF3344;
    color: #000000;
}

/* Grids for Buttons */
.sw-btn-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.sw-btn-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

/* In-Menu Feedback Toast */
.sw-menu-toast {
    background: #FFA000;
    color: #000000;
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 7px 12px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sw-menu-toast.show {
    display: flex;
}

/* --- Batuu Terminal Clearance Modal --- */
#datapad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 6, 10, 0.88);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#datapad-modal {
    width: 92%;
    max-width: 600px;
    background: #000000;
    border: 2px solid #FFA000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 160, 0, 0.25);
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 92vh;
    overflow: hidden;
    box-sizing: border-box;
}

.sw-terminal-header {
    background: #FFA000;
    height: 44px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sw-terminal-title {
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #000000;
    text-transform: uppercase;
}

.sw-terminal-status-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000000;
    opacity: 0.85;
    animation: blinkLedRed 2s infinite;
}

.sw-terminal-aurebesh-banner {
    background: #0d0802;
    border-bottom: 1px solid rgba(255, 160, 0, 0.35);
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    flex-shrink: 0;
}

.sw-terminal-aurebesh {
    font-family: 'Aurebesh', sans-serif;
    font-size: 15px;
    letter-spacing: 2.5px;
    color: #FFB838;
}

.sw-terminal-subtext {
    font-family: var(--sw-font-tech);
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #a08050;
    text-transform: uppercase;
}

.sw-terminal-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #000000;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Archival Notice Box */
.sw-terminal-info-box {
    background: rgba(255, 160, 0, 0.04);
    border: 1px solid rgba(255, 160, 0, 0.3);
    border-left: 3px solid #FFA000;
    padding: 12px 14px;
    border-radius: 2px;
    box-sizing: border-box;
}

.sw-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.sw-info-icon {
    color: #FFA000;
    font-size: 11px;
}

.sw-info-title {
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: #FFA000;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sw-info-body {
    font-family: var(--sw-font-tech);
    font-size: 11.5px;
    line-height: 1.5;
    color: #a8b8c8;
}

.sw-info-body p {
    margin: 0 0 7px 0;
}

.sw-info-body p:last-child {
    margin-bottom: 0;
}

.sw-info-body strong {
    color: #FFA000;
    font-weight: 600;
}

.sw-info-body em {
    color: #ffffff;
    font-style: normal;
}

/* Location Clearance Simple Buttons */
.location-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.location-toggle-btn {
    background: #080c10;
    border: 1.5px solid #1c2a3a;
    color: #7d8f9f;
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 10px 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border-radius: 2px;
    outline: none;
    box-sizing: border-box;
}

.location-toggle-btn:hover {
    border-color: #FFA000;
    color: #ffffff;
    background: #0e1622;
}

.location-toggle-btn.active {
    border-color: #FFA000;
    background: rgba(255, 160, 0, 0.14);
    color: #FFA000;
    box-shadow: 0 0 14px rgba(255, 160, 0, 0.25);
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-label {
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #FFA000;
    text-transform: uppercase;
}

.modal-input {
    background: #080c10;
    border: 1px solid #23354c;
    border-radius: 2px;
    padding: 10px 12px;
    color: #ffffff;
    font-family: 'MorrisSansCondensedMedium', var(--sw-font-tech), sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
    border-color: #FFA000;
    box-shadow: 0 0 10px rgba(255, 160, 0, 0.25);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 160, 0, 0.25);
    padding-top: 16px;
}

.launch-btn {
    background: #FFA000;
    color: #000000;
    font-family: 'MorrisSansCondensedMedium', 'MorrisSans', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
    padding: 12px 28px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 160, 0, 0.35);
    transition: all 0.2s;
}

.launch-btn:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 25px #FFA000;
    transform: translateY(-1px);
}

.danger-link {
    color: #e55c6c;
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--sw-font-tech);
}

.danger-link:hover {
    color: #ff3344;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #datapad-phone-frame {
        width: 100vw !important;
        height: 100vh !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    .datapad-top-notch {
        display: none;
    }
    .location-toggle-group {
        grid-template-columns: 1fr 1fr;
    }
    #datapad-hamburger-menu {
        top: 0;
        height: 100%;
        padding: 8px;
    }
    .sw-menu-card {
        max-width: 95vw;
    }
}
