/* ============================================
   MOBILE-FIRST CSS - PLAN&TRAIN
   Datei: /static/css/mobile-clean.css
   ============================================ */

/* ============================================
   1. RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   2. NAVIGATION - MOBILE FIRST
   ============================================ */

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo/Brand */
.nav-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.nav-brand:hover {
    opacity: 0.9;
}

.logo-icon {
    font-size: 1.5rem;
}

/* Desktop Menu - Hidden on Mobile */
.desktop-menu {
    display: none;
}

/* Mobile Toggle Button */
.mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin: -10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Toggle Animation */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 999;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Info Bar */
.user-info {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Mobile Menu Links */
.mobile-menu nav {
    display: flex;
    flex-direction: column;
}

.mobile-menu a {
    padding: 1rem 1.5rem;
    color: #1f2937;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s ease;
    min-height: 44px;
}

.mobile-menu a:active {
    background: #f3f4f6;
}

.mobile-menu a.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid #667eea;
    font-weight: 600;
    padding-left: calc(1.5rem - 4px);
}

.menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.logout-link {
    color: #ef4444 !important;
}

/* ============================================
   3. MAIN CONTENT - MOBILE FIRST
   ============================================ */

.main-content {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
    background: #ffffff;
}

/* ============================================
   4. FLASH MESSAGES
   ============================================ */

.flash-messages {
    position: fixed;
    top: 70px;
    right: 10px;
    left: 10px;
    z-index: 2000;
    max-width: 400px;
    margin: 0 auto;
}

.flash-message {
    padding: 1rem 2.5rem 1rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.flash-success {
    background: #10b981;
    color: white;
}

.flash-error {
    background: #ef4444;
    color: white;
}

.flash-info {
    background: #3b82f6;
    color: white;
}

.flash-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   5. IPHONE SAFE AREAS
   ============================================ */

@supports (padding: env(safe-area-inset-top)) {
    .navbar {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    
    .mobile-menu {
        top: calc(60px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .main-content {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* ============================================
   6. TABLET (768px+)
   ============================================ */

@media (min-width: 768px) {
    .navbar {
        padding: 1rem 2rem;
    }
    
    .nav-brand {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        font-size: 1.8rem;
    }
    
    /* Hide Mobile Toggle */
    .mobile-toggle {
        display: none !important;
    }
    
    /* Hide Mobile Menu */
    .mobile-menu {
        display: none !important;
    }
    
    /* Show Desktop Menu */
    .desktop-menu {
        display: flex;
        gap: 2rem;
        align-items: center;
    }
    
    .desktop-menu nav {
        display: flex;
        gap: 1rem;
    }
    
    .desktop-menu a {
        color: white;
        text-decoration: none;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        font-weight: 600;
    }
    
    .desktop-menu a:hover {
        background: rgba(255,255,255,0.2);
        transform: translateY(-1px);
    }
    
    .desktop-menu a.active {
        background: rgba(255,255,255,0.25);
    }
    
    /* User Menu Desktop */
    .user-menu {
        display: flex;
        gap: 1rem;
        align-items: center;
    }
    
    .user-btn,
    .login-link,
    .register-link,
    .logout-link,
    .admin-link,
    .settings-link {
        background: rgba(255,255,255,0.2);
        color: white !important;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        text-decoration: none;
        display: inline-block;
        transition: all 0.3s ease;
    }
    
    .user-btn:hover,
    .login-link:hover,
    .register-link:hover,
    .admin-link:hover,
    .settings-link:hover {
        background: rgba(255,255,255,0.3);
    }
    
    .logout-link {
        background: rgba(239, 68, 68, 0.2);
    }
    
    .logout-link:hover {
        background: rgba(239, 68, 68, 0.3);
    }
    
    /* Main Content */
    .main-content {
        padding: 2rem;
        min-height: calc(100vh - 72px);
    }
    
    /* Flash Messages */
    .flash-messages {
        right: 20px;
        left: auto;
        top: 80px;
    }
}

/* ============================================
   7. DESKTOP (1024px+)
   ============================================ */

@media (min-width: 1024px) {
    .navbar {
        padding: 1rem 3rem;
    }
    
    .desktop-menu nav {
        gap: 1.5rem;
    }
    
    .main-content {
        padding: 3rem;
    }
}

/* ============================================
   8. UTILITIES
   ============================================ */

/* Prevent iOS Zoom on Input Focus */
input,
select,
textarea {
    font-size: 16px !important;
}

/* Smooth Scrolling for All Devices */
* {
    -webkit-overflow-scrolling: touch;
}

/* Hide Scrollbar but Keep Functionality */
.mobile-menu::-webkit-scrollbar {
    display: none;
}

.mobile-menu {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Disable Text Selection on UI Elements */
.navbar,
.mobile-toggle,
.flash-message {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Hidden Helper */
.hidden {
    display: none !important;
}