/**
 * CO-NECT Universal Mobile-Responsive CSS
 * Version 2.0 - 31.10.2025
 * 
 * DIESE DATEI IN ALLE SEITEN EINBINDEN:
 * <link rel="stylesheet" href="assets/css/mobile.css">
 * 
 * Funktioniert mit:
 * - index.php
 * - coach-auth.php
 * - coach-dashboard.php
 * - coach-subscription.php
 * - admin-auth.php
 * - Alle anderen Seiten
 */

/* ===== RESET & BASE ===== */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px; /* iOS Auto-Zoom Vermeidung */
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* ===== TOUCH-FREUNDLICHE ELEMENTE ===== */
button,
.btn,
a.button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Touch Feedback */
button:active,
.btn:active,
a:active {
    transform: scale(0.98);
    opacity: 0.8;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

/* ===== FORMULARE ===== */
input,
select,
textarea,
button {
    font-size: 16px !important; /* iOS Auto-Zoom Vermeidung */
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 16px !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color, #1e40af);
}

/* ===== HAMBURGER MENU (für Dashboards) ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary-color, #1e40af);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-height: 44px;
    min-width: 44px;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large Tablets (768px - 991px) */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Sidebar für Dashboards */
    .sidebar,
    .admin-sidebar,
    .coach-sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.active,
    .admin-sidebar.active,
    .coach-sidebar.active {
        left: 0;
    }
    
    .main-content,
    .dashboard-content {
        padding-left: 0 !important;
        padding-top: 70px;
    }
    
    .container,
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
}

/* Tablets & Mobile Landscape (576px - 767px) */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    .sidebar,
    .admin-sidebar,
    .coach-sidebar {
        width: 260px;
    }
    
    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    
    /* Buttons */
    .btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px 16px;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Cards */
    .card,
    .dashboard-card,
    .stat-card {
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Tables */
    .table {
        font-size: 13px;
    }
    
    .table td,
    .table th {
        padding: 8px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    /* Auth Container */
    .auth-container {
        margin: 20px 10px;
        border-radius: 15px;
    }
    
    .auth-header {
        padding: 25px 20px;
    }
    
    .auth-header h1 {
        font-size: 28px;
    }
    
    .auth-body {
        padding: 20px 15px;
    }
    
    /* Grid Anpassungen */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col,
    [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Mobile Portrait (max-width: 575px) */
@media (max-width: 575px) {
    body {
        font-size: 13px;
    }
    
    .mobile-menu-toggle {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 18px;
    }
    
    .sidebar,
    .admin-sidebar,
    .coach-sidebar {
        width: 240px;
    }
    
    .container,
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    h4 { font-size: 14px; }
    
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .auth-container {
        margin: 10px 5px;
        border-radius: 12px;
    }
    
    .auth-header {
        padding: 20px 15px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-body {
        padding: 15px 12px;
    }
    
    .card-body,
    .dashboard-card {
        padding: 12px;
    }
    
    /* Grid - Immer Full Width */
    .col-sm-6,
    .col-md-4,
    .col-md-6,
    .col-lg-3,
    .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    /* Subscription Cards */
    .subscription-card,
    .addon-card {
        margin-bottom: 15px;
    }
}

/* Extra Small Mobile (max-width: 375px) */
@media (max-width: 375px) {
    body {
        font-size: 12px;
    }
    
    .sidebar,
    .admin-sidebar,
    .coach-sidebar {
        width: 220px;
    }
    
    h1 { font-size: 18px; }
    h2 { font-size: 16px; }
    h3 { font-size: 14px; }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
    
    .mobile-menu-toggle {
        padding: 6px 10px;
        font-size: 16px;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar,
    .admin-sidebar,
    .coach-sidebar {
        width: 220px;
        padding: 15px;
    }
    
    .sidebar h3,
    .admin-sidebar h3,
    .coach-sidebar h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .sidebar-menu a,
    .admin-sidebar-menu a,
    .coach-sidebar-menu a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .main-content,
    .dashboard-content {
        padding-top: 60px;
    }
    
    .modal-dialog {
        margin: 5px;
    }
}

/* ===== iOS SPECIFIC ===== */
@supports (-webkit-touch-callout: none) {
    /* Safe Area Insets für iPhone X+ */
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Verhindere Bounce-Effekt */
    .main-content,
    .sidebar,
    .admin-sidebar,
    .coach-sidebar {
        overscroll-behavior: contain;
    }
    
    /* Alle Inputs 16px für Auto-Zoom Vermeidung */
    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
    }
}

/* ===== ANDROID SPECIFIC ===== */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        line-height: normal;
    }
}

/* ===== UTILITY CLASSES ===== */
.mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-hidden {
        display: none !important;
    }
}

/* ===== IMAGES & MEDIA ===== */
img {
    max-width: 100%;
    height: auto;
}

.logo img {
    max-height: 45px;
}

@media (max-width: 767px) {
    .logo img {
        max-height: 35px;
    }
}

/* ===== NAVIGATION ===== */
.nav-links {
    display: flex;
    gap: 20px;
}

@media (max-width: 991px) {
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== STAT CARDS ===== */
.stat-card {
    padding: 20px;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 20px;
}

.stat-card h3 {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}

@media (max-width: 767px) {
    .stat-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .stat-card h3 {
        font-size: 24px;
    }
    
    .stat-card i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 575px) {
    .stat-card {
        padding: 12px;
    }
    
    .stat-card h3 {
        font-size: 20px;
    }
}

/* ===== SUBSCRIPTION/ADDON CARDS ===== */
.subscription-plan,
.addon-item {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.subscription-plan:hover,
.addon-item:hover {
    border-color: var(--primary-color, #1e40af);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@media (max-width: 767px) {
    .subscription-plan,
    .addon-item {
        padding: 15px;
        margin-bottom: 15px;
    }
}

/* ===== ACCESSIBILITY ===== */
*:focus-visible {
    outline: 2px solid var(--primary-color, #1e40af);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .sidebar,
    .admin-sidebar,
    .coach-sidebar,
    .btn,
    button,
    .navbar {
        display: none !important;
    }
    
    .main-content,
    .dashboard-content {
        padding: 0 !important;
    }
}

/* ===== FLOATING ACTION BUTTONS ===== */
.floating-radial-menu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

@media (max-width: 767px) {
    .floating-radial-menu {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-radial-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 18px !important;
    }
}

@media (max-width: 575px) {
    .floating-radial-menu {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-radial-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 16px !important;
    }
}

/* ===== VERHINDERE TEXT-SELECTION BEI DOPPEL-TAP ===== */
.btn,
button,
.navbar-brand,
.logo,
.stat-card,
.sidebar-menu a {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

/* ===== ENDE ===== */
