/*
 * LevelGamer Touch-optimiertes Design
 * Fürmobile Geräte und Touch-Bedienung
 */

/* ============================================
   BASE TOUCH IMPROVEMENTS
   ============================================ */

/* Größere Touch-Flächen für alle interaktiven Elemente */
button, 
a, 
input, 
select, 
textarea,
[role="button"],
[onclick] {
    min-height: 44px;
    min-width: 44px;
}

/* Touch-spezifische Buttons */
.btn,
button,
input[type="submit"],
input[type="button"] {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Links auf Touch-Geräten */
a {
    padding: 8px 4px;
    margin: -8px -4px;
    display: inline-block;
}

/* ============================================
   NAVIGATION
   ============================================ */

/* Hamburger Menu */
.navbar-nav {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: calc(100vh - 60px);
    background: rgba(10, 15, 10, 0.98);
    border-right: 1px solid rgba(45, 90, 30, 0.3);
    padding: 1rem;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    -webkit-overflow-scrolling: touch;
}

.navbar-nav.active {
    transform: translateX(100%);
}

/* Dropdown Menus auf Touch */
.dropdown-menu {
    position: static;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    box-shadow: none;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 12px 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

/* ============================================
   FORMULAR-INPUTS
   ============================================ */

/* Größere Input-Felder */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    padding: 14px 16px;
    font-size: 16px !important; /* Verhindert Zoom auf iOS */
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Selects mit größerer Höhe */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8c29a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Checkboxen und Radios */
input[type="checkbox"],
input[type="radio"] {
    width: 24px;
    height: 24px;
    margin: 0;
}

/* ============================================
   TABS UND NAVIGATION
   ============================================ */

/* Scrollable Tabs */
.server-tabs,
.tab-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
}

.server-tabs::-webkit-scrollbar,
.tab-nav::-webkit-scrollbar {
    display: none;
}

/* Tab Buttons */
.server-tab,
.tab-btn {
    flex-shrink: 0;
    padding: 12px 20px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ============================================
   TABELLEN
   ============================================ */

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -0.5rem;
    padding: 0.5rem;
}

/* Touch-friendly Tabellen-Zeilen */
.table tbody tr {
    min-height: 48px;
}

.table td,
.table th {
    padding: 12px 16px;
    white-space: nowrap;
}

/* ============================================
   CARDS
   ============================================ */

/* Touch-friendly Cards */
.card {
    border-radius: 12px;
    overflow: hidden;
}

.card-header,
.card-footer {
    padding: 16px;
}

/* Card Actions mit größerer Höhe */
.card-footer .btn {
    min-height: 44px;
}

/* ============================================
   MODALS
   ============================================ */

/* Fullscreen Modals auf Mobile */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .modal-content {
        border-radius: 0;
        border: none;
        min-height: 100vh;
    }

    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: inherit;
        z-index: 10;
    }

    .modal-body {
        padding: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 16px;
        position: sticky;
        bottom: 0;
        background: inherit;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

/* Custom Scrollbar für Touch */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(45, 90, 30, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 90, 30, 0.6);
}

/* ============================================
   GESTEN-UNTERSTÜTZUNG
   ============================================ */

/* Swipe-Indikator */
.swipe-indicator {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1001;
}

@media (pointer: coarse) {
    .swipe-indicator {
        display: block;
    }
}

/* ============================================
   PULL-TO-REFRESH
   ============================================ */

.refresh-indicator {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 0;
    background: rgba(45, 90, 30, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.3s;
    z-index: 999;
    overflow: hidden;
}

.refresh-indicator.active {
    height: 60px;
}

.refresh-indicator i {
    color: var(--gold);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   BOTTOM NAVIGATION (Mobile)
   ============================================ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 15, 10, 0.98);
    border-top: 1px solid rgba(45, 90, 30, 0.3);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    .footer {
        margin-bottom: 60px;
    }

    main {
        padding-bottom: 60px;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 8px;
    min-width: 60px;
    transition: color 0.2s;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--gold);
}

.bottom-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.bottom-nav-item span {
    font-size: 0.7rem;
}

/* ============================================
   SAFE AREA (iPhone Notch)
   ============================================ */

@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }

    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   LANDSCAPE MODE
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        height: auto;
        min-height: 50px;
    }

    .navbar-nav {
        top: 50px;
        height: calc(100vh - 50px);
    }

    .bottom-nav {
        height: 50px;
    }

    .bottom-nav-item {
        padding: 4px;
    }

    .bottom-nav-item i {
        font-size: 1.2rem;
    }

    .bottom-nav-item span {
        display: none;
    }
}

/* ============================================
   HOVER DEAKTIVIEREN (Touch)
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Hover-Effekte nur auf Maus-Geräten */
    .btn:hover {
        transform: none;
    }

    .card:hover {
        transform: none;
    }

    .equipment-slot:hover {
        border-color: rgba(45, 90, 30, 0.4);
        background: rgba(0, 0, 0, 0.4);
    }

    /* Active-State statt Hover */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .card:active {
        transform: scale(0.99);
    }
}

/* ============================================
   DRAG & DROP TOUCH
   ============================================ */

/* Touch Drag Ghost */
.touch-dragging {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.9;
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Drop Zones highlighten */
.drop-zone-active {
    border-color: var(--gold) !important;
    background: rgba(201, 168, 76, 0.2) !important;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(45, 90, 30, 0.1) 25%, 
        rgba(45, 90, 30, 0.2) 50%, 
        rgba(45, 90, 30, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   NOTIFICATION BADGES
   ============================================ */

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #f44336;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */

.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
    z-index: 999;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:active {
    transform: scale(0.95);
}

@media (min-width: 769px) {
    .fab {
        display: none;
    }
}

/* ============================================
   ZOOM-PINCH SUPPORT
   ============================================ */

.zoomable {
    touch-action: pinch-zoom;
    transform-origin: center center;
}

/* ============================================
   HAPTIC FEEDBACK (visuell)
   ============================================ */

@keyframes haptic {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.haptic-feedback:active {
    animation: haptic 0.1s ease;
}
