/* ===========================================================================
   BAMBU STUDIO CONTROL CENTER - Responsive Anpassungen
   ===========================================================================
    Version: v2.1.3
   Datei: html/css/responsive.css
   Erstellt: 16.04.2026
   ===========================================================================

   MODUL-FUNKTION
   ---------------
   Enthaelt alle Media Queries fuer responsive Anpassungen:
   - Tablets und grosse Smartphones (max 768px): Hamburger-Menu statt
     Tab-Leiste, kompaktere Darstellung, vollbreite Modals.
   - Kleine Smartphones (max 480px): Minimale Schriftgroessen, reduzierte
     Paddings, optimiert fuer Samsung S21 Ultra (412px Viewport).

   =========================================================================== */

/* ===========================================================================
   HAMBURGER-BUTTON: Auf Desktop versteckt
   =========================================================================== */
.hamburger-toggle {
    display: none;
}

/* Mobile-Nav: Auf Desktop versteckt */
.mobile-nav-overlay,
.mobile-nav {
    display: none;
}

/* ===========================================================================
   TABLETS UND GROSSE SMARTPHONES (max 768px)
   =========================================================================== */
@media (max-width: 768px) {
    /* Kleinere Schriftgroessen */
    html {
        font-size: 14px;
    }

    /* ---------------------------------------------------------------
       HAMBURGER-BUTTON
       --------------------------------------------------------------- */
    .hamburger-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background-color: var(--bg-tertiary);
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
    }

    .hamburger-toggle:hover {
        background-color: var(--bg-hover);
        border-color: var(--accent-primary);
    }

    .hamburger-bar {
        display: block;
        width: 20px;
        height: 2px;
        background-color: var(--text-secondary);
        border-radius: 1px;
        transition: all 0.3s ease;
    }

    /* Hamburger-Animation: X wenn offen */
    .hamburger-toggle.active .hamburger-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger-toggle.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-toggle.active .hamburger-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ---------------------------------------------------------------
       DESKTOP-TAB-NAVIGATION AUSBLENDEN
       --------------------------------------------------------------- */
    .tab-navigation {
        display: none;
    }

    /* ---------------------------------------------------------------
       MOBILE NAVIGATION: Slide-in von links
       --------------------------------------------------------------- */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-nav-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100%;
        background-color: var(--bg-secondary);
        border-right: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg, 4px 0 16px rgba(0,0,0,0.2));
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .mobile-nav.open {
        transform: translateX(0);
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-nav-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .mobile-nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 6px;
        background: none;
        color: var(--text-secondary);
        font-size: 1.4rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-nav-close:hover {
        background-color: var(--bg-hover);
        color: var(--text-primary);
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border: none;
        background: none;
        color: var(--text-secondary);
        font-family: 'Roboto Condensed';
        font-size: 0.95rem;
        font-weight: 400;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: left;
        width: 100%;
        border-left: 3px solid transparent;
    }

    .mobile-nav-item:hover {
        background-color: var(--bg-hover);
        color: var(--text-primary);
    }

    .mobile-nav-item.active {
        color: var(--accent-primary);
        font-weight: 700;
        background-color: var(--bg-hover);
        border-left-color: var(--accent-primary);
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    /* ---------------------------------------------------------------
       HEADER
       --------------------------------------------------------------- */
    .app-header {
        padding: 10px 14px;
    }

    .header-right {
        gap: 8px;
    }

    .header-icon {
        width: 28px;
        height: 28px;
    }

    .header-title h1 {
        font-size: 1.15rem;
    }

    /* ---------------------------------------------------------------
       HAUPTINHALT
       --------------------------------------------------------------- */
    .main-content {
        padding: 14px;
    }

    .instrument-hero,
    .instrument-gauge-grid,
    .instrument-lower-grid,
    .instrument-meta-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-style-switcher {
        flex-wrap: wrap;
    }

    .instrument-progress-panel {
        margin-top: 8px;
    }

    .instrument-progress-ring-wrap {
        width: 188px;
        height: 188px;
    }

    .instrument-progress-svg {
        width: 188px;
        height: 188px;
    }

    .instrument-thumbnail {
        width: 108px;
        height: 108px;
    }

    .instrument-ams-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Toolbar: Untereinander statt nebeneinander */
    .toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .toolbar-left {
        width: 100%;
    }

    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-wrapper {
        max-width: 100%;
    }

    /* Tabelle: Horizontal scrollbar */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tabelle: Kleinere Paddings */
    .filament-table th,
    .filament-table td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    /* Drucker-Tags kleiner */
    .printer-tag {
        font-size: 0.72rem;
        padding: 1px 6px;
    }

    /* Config-Karten */
    .config-card {
        padding: 16px;
    }

    /* Hilfe-Karten */
    .help-card {
        padding: 16px;
    }

    .help-step {
        gap: 12px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.95rem;
    }

    /* Hilfe-Sub-Tabs kompakter */
    .help-subtab-nav {
        gap: 6px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .help-subtab-button {
        padding: 6px 14px;
        font-size: 0.82rem;
    }

    /* Backup-Buttons gestapelt */
    .config-backup-row {
        flex-direction: column;
    }

    /* Modals: Vollbreite auf Mobil */
    .modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    /* JSON-Ansicht: Kleinere Schrift */
    .code-pre {
        font-size: 9.5px;
        padding: 10px;
        line-height: 1.4;
    }

    /* Toasts: Volle Breite am unteren Rand */
    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
    }

    /* Footer kompakter */
    .app-footer {
        padding: 10px 14px;
        font-size: 0.75rem;
    }

    /* Dashboard: Hauptbereich vertikal stapeln */
    .dashboard-main {
        flex-wrap: wrap;
        gap: 16px;
        padding: 16px 12px;
    }

    .dashboard-thumbnail-img {
        width: 80px;
        height: 80px;
    }

    /* Luefter-Balken: Vertikal stapeln */
    .dashboard-fans {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    /* AMS-Slots kompakter */
    .dashboard-ams {
        gap: 10px;
        padding: 12px;
    }
}

/* ===========================================================================
   KLEINE SMARTPHONES (max 480px) - Optimiert fuer Samsung S21 Ultra (412px)
   =========================================================================== */
@media (max-width: 480px) {
    /* Deutlich kleinere Basis-Schriftgroesse */
    html {
        font-size: 12px;
    }

    /* Header: Maximal kompakt */
    .app-header {
        padding: 8px 10px;
    }

    .header-icon {
        width: 24px;
        height: 24px;
    }

    .header-title h1 {
        font-size: 0.95rem;
    }

    .header-version {
        display: none;
    }

    .header-left {
        gap: 8px;
    }

    .header-right {
        gap: 6px;
    }

    /* Hamburger und Theme-Toggle kleiner */
    .hamburger-toggle,
    .theme-toggle {
        width: 34px;
        height: 34px;
    }

    .hamburger-bar {
        width: 17px;
        height: 2px;
    }

    .hamburger-toggle {
        gap: 4px;
    }

    .theme-toggle svg {
        width: 17px;
        height: 17px;
    }

    .theme-toggle .material-symbols-outlined {
        font-size: 19px;
    }

    /* Mobile-Nav schmaler */
    .mobile-nav {
        width: 220px;
    }

    .mobile-nav-item {
        padding: 12px 14px;
        font-size: 0.88rem;
        gap: 10px;
    }

    .mobile-nav-item svg {
        width: 18px;
        height: 18px;
    }

    /* Hauptinhalt: Minimales Padding */
    .main-content {
        padding: 10px;
    }

    /* Toolbar noch kompakter */
    .toolbar {
        gap: 8px;
    }

    .search-input {
        font-size: 0.85rem;
        padding: 6px 10px 6px 32px;
    }

    /* Statistik-Badge: Kompakter */
    .stats-badge {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    /* Tabelle: Minimale Paddings */
    .filament-table th,
    .filament-table td {
        padding: 5px 6px;
        font-size: 0.75rem;
    }

    .filament-table th {
        font-size: 0.7rem;
    }

    /* Drucker-Tags: Minimal */
    .printer-tag {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    /* Status-Punkt kleiner */
    .status-dot {
        width: 8px;
        height: 8px;
    }

    /* Drucker-Bezeichnung unter dem Profilnamen */
    .drucker-bezeichnung {
        font-size: 0.7rem;
    }

    /* Action-Buttons: Kompakter */
    .btn-icon {
        width: 28px;
        height: 28px;
    }

    .btn-icon svg {
        width: 14px;
        height: 14px;
    }

    .td-actions {
        gap: 2px;
    }

    /* Buttons: Nur Icon, kleiner */
    .btn span {
        display: none;
    }

    .btn {
        padding: 6px 8px;
        font-size: 0.78rem;
    }

    .btn svg {
        width: 15px;
        height: 15px;
    }

    /* Config-Karten: Weniger Padding */
    .config-card {
        padding: 12px;
    }

    .config-title {
        font-size: 1rem;
    }

    .config-label {
        font-size: 0.82rem;
    }

    .config-input {
        font-size: 0.82rem;
        padding: 6px 8px;
    }

    .config-hint {
        font-size: 0.72rem;
    }

    .config-textarea {
        font-size: 0.82rem;
    }

    /* Drucker-Checkliste: Niedrigere Max-Hoehe */
    .printer-checklist {
        max-height: 200px;
    }

    /* Modals: Noch kompakter */
    .modal-header {
        padding: 10px 12px;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 10px 12px;
    }

    .modal-footer {
        padding: 8px 12px;
    }

    /* Hilfe-Karten */
    .help-card {
        padding: 12px;
    }

    .help-card h3 {
        font-size: 0.95rem;
    }

    .help-card p,
    .help-card li {
        font-size: 0.82rem;
    }

    .help-subtab-button {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    /* Hilfe-Schritte: Kompakter */
    .step-number {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.8rem;
    }

    /* JSON-Ansicht: Minimale Schrift */
    .code-pre {
        font-size: 8px;
        padding: 8px;
        line-height: 1.35;
    }

    /* Footer */
    .app-footer {
        padding: 8px 10px;
        font-size: 0.7rem;
    }
}
