/* Mobile CSS for LogBook App */
@import url('/static/css/admin.css');

/* Globaler Reset für einheitliches Box-Modell (inklusive Padding und Border) */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: #121217;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-light);
    overscroll-behavior-y: none; /* Verhindert Bouncing auf iOS */
}

.mobile-app {
    display: flex;
    flex-direction: column;
    height: 90vh; /* Changed from 100vh based on user request */
    width: 100vw;
    overflow: hidden;
}

/* Header */
.mobile-header {
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}
.mobile-header h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
}
.header-actions {
    display: flex;
    gap: 15px;
}

/* Main Content Area */
.mobile-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-bottom: env(safe-area-inset-bottom); /* iPhone X Support */
    z-index: 100;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    transition: all 0.2s;
    cursor: pointer;
}
.nav-item i {
    font-size: 1.2rem;
}
.nav-item.active {
    color: var(--primary);
}

/* Map specific */
#mobile-map {
    width: 100%;
    height: 100%;
}
.map-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
}
.vehicle-selector-mobile {
    width: 100%;
    padding: 12px;
    background: rgba(30,30,46,0.9);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    border-radius: 12px;
    font-size: 1rem;
    margin-top: 10px;
}

/* Lists and Cards */
.mobile-list {
    width: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mobile-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 15px;
}
.trip-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.trip-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.trip-date { font-weight: bold; font-size: 0.9rem; }
.trip-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Swipe Quick Actions */
.quick-action-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
}
.btn-privat { background: var(--success); }
.btn-dienst { background: var(--primary); }
.btn-navigieren { background: #e74c3c; width: 100%; padding: 12px; margin-top: 10px; border-radius: 8px;}

/* Stat Grid */
.stat-grid-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stat-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.stat-box i { font-size: 1.5rem; color: var(--primary); margin-bottom: 8px; }
.stat-value { font-size: 1.2rem; font-weight: bold; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }

/* HUD Dashboard Styles (Live-Diagnose) */
.hud-container {
    display: grid;
    /* minmax(0, 1fr) verhindert das Ausbrechen von Spalten bei Charts */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 15px;
    padding: 10px 0;
    width: 100%;
}
.hud-panel {
    background: rgba(10, 15, 30, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 210, 255, 0.05);
    position: relative;
    overflow: hidden;
    width: 100%;
    min-width: 0; /* Verhindert das Ausdehnen durch Canvas-Inhalt */
}
.hud-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.8), transparent);
}
.hud-title {
    font-size: 0.75rem;
    color: #8bb4e7;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}
.hud-value-container {
    position: relative;
    width: 100%;
    height: 100px;
}
.hud-status-ok { color: #00ffcc; text-shadow: 0 0 8px rgba(0, 255, 204, 0.5); }
.hud-status-warn { color: #ffcc00; text-shadow: 0 0 8px rgba(255, 204, 0, 0.5); }
.hud-status-danger { color: #ff3366; text-shadow: 0 0 8px rgba(255, 51, 102, 0.5); }

.vehicle-model-container {
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0; /* Verhindert das Ausdehnen */
}
.dtc-alert {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.4);
    color: #ff3366;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.hud-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.4);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* SOS & Unfall-Assistent Styles */
.btn-danger-sos {
    background: #ff3366;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.4);
    animation: pulse-sos 2s infinite;
}

@keyframes pulse-sos {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(255, 51, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 102, 0);
    }
}

.btn-emergency-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #28a745;
    color: white !important;
    text-decoration: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.15em;
    font-weight: bold;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: background 0.2s, transform 0.1s;
    border: none;
    cursor: pointer;
}

.btn-emergency-call:active {
    background: #218838;
    transform: scale(0.98);
}

.unfall-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.unfall-tab {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.unfall-tab.active {
    color: #00d2ff;
    border-bottom: 2px solid #00d2ff;
}

.warning-box {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    color: #ffc107;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.danger-box {
    background: rgba(255, 51, 102, 0.1);
    border-left: 4px solid #ff3366;
    color: #ff3366;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--text-light);
}

.checklist-item i {
    color: #00d2ff;
    margin-top: 3px;
    font-size: 0.95em;
}

/* Photo Grid Preview */
.photo-grid-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.photo-preview-item {
    position: relative;
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 51, 102, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    padding: 0;
}

/* Blink-Animation für Unfall-Dokumentations-Tab */
.blink-tab {
    animation: blinker-sos 1s linear infinite;
    color: #ff3366 !important;
    font-weight: bold;
}

@keyframes blinker-sos {
    50% {
        opacity: 0.15;
    }
}

/* --- Torque Pro HUD Styles --- */
.hud-toggle-bar {
    display: flex;
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}
.hud-toggle-item {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.hud-toggle-item.active {
    background: rgba(0, 210, 255, 0.15);
    color: #00d2ff;
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.1);
}

.hud-settings-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}
.hud-settings-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.hud-digital-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
    width: 100%;
}
.hud-digital-value {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: monospace, sans-serif;
    letter-spacing: 1px;
    line-height: 1;
    text-shadow: 0 0 12px currentColor;
}
.hud-digital-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.dyno-panel {
    width: 100%;
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0; /* Verhindert das Ausdehnen */
}
.dyno-time-display {
    font-size: 3rem;
    font-weight: bold;
    font-family: monospace;
    color: #ffcc00;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
    margin: 10px 0;
}
.dyno-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.alarm-flashing {
    animation: alarm-pulse-border 1.5s infinite;
}
@keyframes alarm-pulse-border {
    0% {
        border-color: rgba(255, 51, 102, 0.4);
        box-shadow: 0 0 5px rgba(255, 51, 102, 0.2);
    }
    50% {
        border-color: rgba(255, 51, 102, 1);
        box-shadow: 0 0 15px rgba(255, 51, 102, 0.6);
    }
    100% {
        border-color: rgba(255, 51, 102, 0.4);
        box-shadow: 0 0 5px rgba(255, 51, 102, 0.2);
    }
}

.hud-alarm-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 5px solid #ff3366;
    box-shadow: inset 0 0 30px rgba(255,51,102,0.4);
    pointer-events: none;
    z-index: 9999;
    animation: alarm-screen-pulse 1.2s infinite;
}
@keyframes alarm-screen-pulse {
    0% { opacity: 0.1; }
    50% { opacity: 0.5; }
    100% { opacity: 0.1; }
}

.hud-input {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    padding: 5px 8px;
    width: 80px;
    text-align: center;
    font-weight: bold;
}
.hud-input:focus {
    border-color: #00d2ff;
    outline: none;
}
.hud-btn {
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid #00d2ff;
    color: #00d2ff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.hud-btn:hover {
    background: #00d2ff;
    color: #121217;
}
.hud-btn-danger {
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid #ff3366;
    color: #ff3366;
}
.hud-btn-danger:hover {
    background: #ff3366;
    color: white;
}
.hud-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


