@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700;900&family=Roboto:wght@400;700&display=swap');

:root {
    /* Airline Theme */
    --primary: #03a9f4; 
    --primary-dim: #0277bd;
    --bg-glass: rgba(18, 18, 18, 0.95);
    --text-main: #ffffff;
    --text-dim: #aaaaaa;
    --border: 1px solid rgba(3, 169, 244, 0.3);
    --green: #00e676;
    --orange: #ff9800;
    --red: #ff5252;
    --accent: #81d4fa;
}

body {
    margin: 0; padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: transparent;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh; width: 100vw;
    user-select: none;
}

#tracker-app {
    position: absolute;
    top: 50px; left: 50px;
    width: 320px; /* Standard Width */
    background: var(--bg-glass);
    border: var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, height 0.2s ease, border-radius 0.2s ease;
    min-height: 200px;
}

/* --- MINI MODE (Double Line Bar) --- */
#tracker-app.mini-mode {
    width: 420px !important;
    height: 74px !important; /* Double Line Height */
    min-height: 74px !important;
    border-radius: 12px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--primary);
}

/* Hide Standard Elements in Mini Mode */
#tracker-app.mini-mode header, 
#tracker-app.mini-mode #sky-container, 
#tracker-app.mini-mode #content {
    display: none !important;
}

/* Show Micro Elements in Mini Mode */
#micro-view {
    display: none;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 0 12px;
    font-family: 'Rajdhani', sans-serif;
    cursor: move;
}

#tracker-app.mini-mode #micro-view { display: flex; }

/* Mini Rows */
.micro-row {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; height: 50%;
}

.micro-group { display: flex; align-items: center; gap: 8px; }
.micro-sep { width: 1px; height: 12px; background: rgba(255,255,255,0.2); }

.micro-label { color: var(--text-dim); font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; }
.micro-val { color: #fff; font-weight: 700; font-size: 0.9em; }
.micro-val.highlight { color: var(--primary); }
.micro-val.active { color: var(--green); }
.micro-val.urgent { color: var(--red); }

/* Mini Progress Bar */
.micro-progress-bg {
    width: 60px; height: 6px; background: rgba(255,255,255,0.1);
    border-radius: 3px; overflow: hidden; margin: 0 5px;
}
.micro-progress-fill {
    height: 100%; background: var(--primary); width: 0%;
}

.micro-btn {
    position: absolute; top: 4px; right: 4px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: #aaa; padding: 0px 4px; border-radius: 3px; 
    font-size: 0.6em; cursor: pointer; text-transform: uppercase;
}
.micro-btn:hover { background: var(--primary); color: white; }

/* --- STANDARD HEADER & SKY --- */
header {
    background: linear-gradient(180deg, var(--primary-dim), rgba(3, 169, 244, 0.2));
    height: 65px; 
    padding: 0 10px;
    cursor: move;
    position: relative;
    display: flex; align-items: flex-start; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    overflow: hidden; 
    padding-top: 5px;
}

.header-title {
    position: absolute; left: 50%; top: 25%;
    transform: translate(-50%, -50%);
    font-family: 'Rajdhani', sans-serif; 
    font-weight: 900; font-size: 1.2em;
    text-transform: uppercase; letter-spacing: 2px;
    color: #fff; pointer-events: none; white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
}

#user-name-fly {
    position: absolute; top: 38px; left: -150px;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 0.95em;
    color: #fff; white-space: nowrap; pointer-events: none; z-index: 10;
    text-shadow: 0 0 5px var(--primary), 0 0 10px var(--accent), 0 0 20px var(--primary-dim);
}

@keyframes flyCycle {
    0% { left: -150px; transform: translateX(0) translateY(0); opacity: 0; }
    10% { left: 50%; transform: translateX(-50%) translateY(0); opacity: 1; } 
    20% { left: 50%; transform: translateX(-50%) translateY(-2px); }
    30% { left: 50%; transform: translateX(-50%) translateY(1px); }
    40% { left: 50%; transform: translateX(-50%) translateY(-1px); }
    50% { left: 50%; transform: translateX(-50%) translateY(2px); }
    60% { left: 50%; transform: translateX(-50%) translateY(-2px); }
    70% { left: 50%; transform: translateX(-50%) translateY(1px); }
    80% { left: 50%; transform: translateX(-50%) translateY(0); }
    90% { left: 50%; transform: translateX(-50%); opacity: 1; }
    100% { left: 120%; transform: translateX(0); opacity: 0; } 
}

.cloud { position: absolute; background-image: url('https://pngimg.com/uploads/cloud/cloud_PNG112272.png'); background-size: contain; background-repeat: no-repeat; opacity: 0.25; pointer-events: none; z-index: 1; }
.cloud-1 { top: 10px; left: -50px; width: 60px; height: 30px; animation: floatCloud 25s linear infinite; }
.cloud-2 { top: 35px; left: -60px; width: 40px; height: 20px; animation: floatCloud 35s linear infinite 5s; }
.cloud-3 { top: 20px; left: -40px; width: 50px; height: 25px; animation: floatCloud 45s linear infinite 12s; }
@keyframes floatCloud { 0% { transform: translateX(0); } 100% { transform: translateX(450px); } }

.header-controls { display: flex; gap: 8px; z-index: 20; align-items: center; }
.nav-icon { text-decoration: none; font-size: 1.1em; cursor: pointer; color: #ccc; }
.nav-icon:hover { color: #fff; }

#mini-btn { font-family: 'Rajdhani', sans-serif; font-weight: bold; font-size: 0.75em; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); color: #ccc; padding: 2px 5px; border-radius: 4px; cursor: pointer; }
#mini-btn:hover { background: var(--primary); color: white; border-color: var(--accent); }
#clock { font-family: 'Rajdhani', sans-serif; font-weight: 700; color: #fff; font-size: 0.85em; z-index: 20; margin-top: 4px; }

/* --- STANDARD CONTENT --- */
#content { padding: 10px; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.route-box { background: rgba(3, 169, 244, 0.1); border: 1px dashed var(--accent); border-radius: 6px; padding: 5px; margin-bottom: 6px; text-align: center; }
.route-label { font-size: 0.6em; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1px; }
.route-name { font-family: 'Rajdhani', sans-serif; font-size: 0.95em; font-weight: 700; color: #fff; line-height: 1.1; margin-bottom: 2px; }
.route-progress { font-size: 0.75em; color: var(--text-dim); font-weight: bold; }
.status-container { background: rgba(255,255,255,0.05); border-radius: 6px; padding: 4px; margin-bottom: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.status-line { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 0.8em; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 1px; }
.timer-line { font-family: 'Rajdhani', sans-serif; font-weight: 900; font-size: 1.1em; color: var(--text-dim); line-height: 1; transition: color 0.2s ease; }
.timer-line.active { color: var(--green); text-shadow: 0 0 8px rgba(0, 230, 118, 0.4); }
.timer-line.urgent { color: var(--red); text-shadow: 0 0 8px rgba(255, 82, 82, 0.6); }
.section { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.section:last-child { border-bottom: none; }
.label { font-size: 0.7em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 2px; }
.value { font-size: 1.1em; font-weight: bold; color: var(--text-main); }
.value.highlight { color: var(--primary); }
.value.bxp { color: var(--green); }
.progress-container { position: relative; height: 14px; background: rgba(0,0,0,0.5); border-radius: 4px; margin: 4px 0 4px 0; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s ease; }
.progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 0.65em; text-shadow: 1px 1px 2px black; font-weight: bold; z-index: 2; }
.xp-remaining-text { text-align: center; font-size: 0.75em; color: var(--text-dim); margin-bottom: 8px; }
.xp-remaining-text b { color: var(--primary); }
.run-box { background: rgba(79, 195, 247, 0.1); border: 1px solid rgba(79, 195, 247, 0.3); border-radius: 4px; padding: 6px; margin-bottom: 8px; }
.run-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.85em; }
.run-val { font-weight: bold; color: #fff; }
.run-label { font-size: 0.8em; color: #aaa; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.stat-box { background: rgba(255,255,255,0.05); padding: 5px; border-radius: 4px; text-align: center; }
.inv-row { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); padding: 4px 8px; margin-bottom: 4px; border-radius: 4px; border-left: 3px solid var(--text-dim); }
.inv-name { font-size: 0.85em; }
.inv-stats { font-size: 0.9em; font-weight: bold; text-align: right; }
.low-stock { border-left-color: var(--red); background: rgba(255, 82, 82, 0.1); }
input[type="number"] { width: 90%; background: rgba(0,0,0,0.3); border: 1px solid #444; color: white; padding: 4px; border-radius: 4px; margin-top: 4px; font-family: inherit; font-size: 0.9em; }
input:focus { outline: 1px solid var(--primary); }
.calc-output { margin-top: 4px; font-size: 0.75em; line-height: 1.2; color: var(--text-dim); word-wrap: break-word; }
.quick-btn-row { display: flex; gap: 5px; margin-top: 5px; justify-content: center; }
.quick-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #ccc; font-size: 0.7em; padding: 2px 6px; border-radius: 3px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: bold; flex: 1; }
.quick-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

#settings-panel, #job-list, #summary-table { display: none !important; }
