/* Mobile App Styles - CB FF Manager */
/* AdminLTE Farbschema */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --white: #ffffff;
    --nav-height: 60px;
    --content-margin-bottom: 70px;
}

/* Mobile-Only Styles */
@media (max-width: 768px) {
    /* Hide desktop sidebar on mobile */
    .main-sidebar {
        display: none !important;
    }

    /* Adjust main content for mobile */
    .content-wrapper {
        margin-left: 0 !important;
        margin-bottom: var(--content-margin-bottom) !important;
        padding-bottom: 20px;
    }

    /* Hide desktop navbar on mobile */
    .main-header {
        display: none !important;
    }

    /* Mobile Header */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--nav-height);
        background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 1030;
    }

    .mobile-header h1 {
        font-size: 1.2rem;
        margin: 0;
        font-weight: 600;
    }

    .mobile-header-logo {
        height: 35px;
        width: auto;
    }

    /* Adjust content-wrapper padding for fixed header */
    .content-wrapper {
        margin-top: var(--nav-height) !important;
        padding-top: 15px;
    }

    /* Bottom Navigation Bar */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--nav-height);
        background: var(--white);
        border-top: 1px solid #e0e0e0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 5px 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1030;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--secondary-color);
        flex: 1;
        padding: 5px;
        transition: all 0.3s ease;
        position: relative;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item:active {
        text-decoration: none;
    }

    .mobile-nav-item i {
        font-size: 1.5rem;
        margin-bottom: 3px;
        transition: all 0.3s ease;
    }

    .mobile-nav-item span {
        font-size: 0.7rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .mobile-nav-item.active {
        color: var(--primary-color);
    }

    .mobile-nav-item.active i {
        transform: scale(1.1);
    }

    /* Badge for notifications */
    .mobile-nav-badge {
        position: absolute;
        top: 0;
        right: 20%;
        background: var(--danger-color);
        color: var(--white);
        border-radius: 10px;
        padding: 2px 6px;
        font-size: 0.6rem;
        font-weight: bold;
        min-width: 18px;
        text-align: center;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

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

    /* Mobile Slide-up Menu */
    .mobile-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-radius: 20px 20px 0 0;
        max-height: 70vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    }

    .mobile-menu.active {
        transform: translateY(0);
    }

    .mobile-menu-header {
        padding: 20px;
        border-bottom: 1px solid #e0e0e0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--light-color);
        border-radius: 20px 20px 0 0;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .mobile-menu-header h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--dark-color);
    }

    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--secondary-color);
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-content {
        padding: 10px 0;
    }

    .mobile-menu-item {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        color: var(--dark-color);
        text-decoration: none;
        transition: background 0.2s ease;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-menu-item:hover {
        background: var(--light-color);
        text-decoration: none;
    }

    .mobile-menu-item i {
        font-size: 1.2rem;
        width: 30px;
        color: var(--primary-color);
    }

    .mobile-menu-item span {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .mobile-menu-divider {
        height: 1px;
        background: #e0e0e0;
        margin: 10px 20px;
    }

    .mobile-menu-section-title {
        padding: 15px 20px 10px;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--secondary-color);
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    /* Cards optimization for mobile */
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .card-header {
        border-radius: 12px 12px 0 0 !important;
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }

    /* Mobile Content Header */
    .content-header {
        padding: 15px 15px 10px;
    }

    .content-header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    /* Table responsive optimization */
    .table-responsive {
        border: none;
        margin-bottom: 0;
    }

    .table {
        font-size: 0.85rem;
    }

    .table td, .table th {
        padding: 10px 5px;
    }

    /* Button optimizations */
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .btn-group {
        display: flex;
    }

    /* Form optimizations */
    .form-control {
        font-size: 1rem;
        padding: 10px 15px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    /* Calendar mobile optimization */
    .fc {
        font-size: 0.85rem;
    }

    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .fc-button {
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    .fc-header-toolbar {
        margin-bottom: 15px !important;
    }

    /* Small box optimization */
    .small-box {
        margin-bottom: 15px;
    }

    .small-box .inner {
        padding: 15px;
    }

    .small-box h3 {
        font-size: 2rem;
    }

    /* Alert optimization */
    .alert {
        font-size: 0.9rem;
        padding: 12px;
        margin-bottom: 15px;
    }

    /* Badge optimization */
    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Search input */
    .input-group {
        margin-bottom: 15px;
    }

    /* User list mobile cards instead of table */
    .mobile-user-card {
        background: var(--white);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-left: 4px solid var(--primary-color);
    }

    .mobile-user-card h5 {
        margin: 0 0 10px;
        font-size: 1.1rem;
        color: var(--dark-color);
    }

    .mobile-user-info {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
    }

    .mobile-user-info-item {
        display: flex;
        align-items: center;
        font-size: 0.85rem;
        color: var(--secondary-color);
    }

    .mobile-user-info-item i {
        margin-right: 5px;
        color: var(--primary-color);
    }

    .mobile-user-actions {
        display: flex;
        gap: 10px;
        margin-top: 10px;
    }

    /* Pull to refresh indicator */
    .pull-to-refresh {
        position: fixed;
        top: var(--nav-height);
        left: 50%;
        transform: translateX(-50%) translateY(-100%);
        padding: 10px 20px;
        background: var(--primary-color);
        color: var(--white);
        border-radius: 20px;
        font-size: 0.9rem;
        z-index: 1000;
        transition: transform 0.3s ease;
    }

    .pull-to-refresh.active {
        transform: translateX(-50%) translateY(10px);
    }

    /* Floating action button */
    .mobile-fab {
        position: fixed;
        bottom: calc(var(--nav-height) + 20px);
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--success-color);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        text-decoration: none;
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .mobile-fab:hover {
        transform: scale(1.1);
        text-decoration: none;
        color: var(--white);
    }

    /* Loading spinner */
    .mobile-loading {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2000;
    }

    .mobile-loading-spinner {
        border: 3px solid var(--light-color);
        border-top: 3px solid var(--primary-color);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* Hide elements not needed on mobile */
    .mobile-hide {
        display: none !important;
    }

    /* Show only on mobile */
    .mobile-only {
        display: block !important;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .mobile-header,
    .mobile-bottom-nav,
    .mobile-menu,
    .mobile-menu-overlay,
    .mobile-fab,
    .mobile-only {
        display: none !important;
    }
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

