/**
 * Mobile Navigation Styles for WebView Applications
 * Provides native mobile app-like styling and behavior
 */

/* Mobile App Body Styles */
body.mobile-app-mode {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

/* Mobile App Header */
.mobile-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-app-header.dark-theme {
    background: #1a1a1a;
    border-bottom-color: #333;
    color: #fff;
}

/* Mobile Back Button */
.mobile-back-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    padding: 8px;
    margin-right: 16px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-back-btn:hover {
    background-color: #f5f5f5;
}

.mobile-back-btn:active {
    background-color: #e0e0e0;
    transform: scale(0.95);
}

.dark-theme .mobile-back-btn {
    color: #fff;
}

.dark-theme .mobile-back-btn:hover {
    background-color: #333;
}

.dark-theme .mobile-back-btn:active {
    background-color: #444;
}

/* Mobile Page Title */
.mobile-page-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
}

.dark-theme .mobile-page-title {
    color: #fff;
}

/* Mobile Header Actions */
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header-action {
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-header-action:hover {
    background-color: #f5f5f5;
}

.dark-theme .mobile-header-action {
    color: #fff;
}

.dark-theme .mobile-header-action:hover {
    background-color: #333;
}

/* Content Padding for Fixed Header */
.mobile-content {
    padding-top: 70px;
    min-height: calc(100vh - 70px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Menu */
.mobile-nav-menu {
    position: fixed;
    top: 60px;
    left: -300px;
    width: 280px;
    height: calc(100vh - 60px);
    background: #fff;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-nav-menu.active {
    left: 0;
}

.dark-theme .mobile-nav-menu {
    background: #1a1a1a;
}

/* Mobile Navigation Items */
.mobile-nav-item {
    display: block;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.mobile-nav-item:hover {
    background-color: #f8f9fa;
    color: #333;
}

.mobile-nav-item.active {
    background-color: #007bff;
    color: #fff;
}

.dark-theme .mobile-nav-item {
    color: #fff;
    border-bottom-color: #333;
}

.dark-theme .mobile-nav-item:hover {
    background-color: #333;
    color: #fff;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 16px;
}

.dark-theme .mobile-bottom-nav {
    background: #1a1a1a;
    border-top-color: #333;
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    transition: color 0.2s ease;
    padding: 8px;
    border-radius: 8px;
}

.mobile-bottom-nav-item:hover {
    color: #007bff;
}

.mobile-bottom-nav-item.active {
    color: #007bff;
}

.mobile-bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.dark-theme .mobile-bottom-nav-item {
    color: #ccc;
}

.dark-theme .mobile-bottom-nav-item:hover,
.dark-theme .mobile-bottom-nav-item.active {
    color: #007bff;
}

/* Mobile Loading Indicator */
.mobile-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.mobile-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Mobile Toast Notifications */
.mobile-toast {
    position: fixed;
    top: 80px;
    left: 16px;
    right: 16px;
    background: #333;
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    z-index: 1500;
    transform: translateY(-100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.mobile-toast.success {
    background: #28a745;
}

.mobile-toast.error {
    background: #dc3545;
}

.mobile-toast.warning {
    background: #ffc107;
    color: #333;
}

.mobile-toast.info {
    background: #17a2b8;
}

/* Mobile Confirmation Dialog */
.mobile-confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-confirm-dialog.show {
    opacity: 1;
    visibility: visible;
}

.mobile-confirm-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin: 16px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

.dark-theme .mobile-confirm-content {
    background: #1a1a1a;
    color: #fff;
}

.mobile-confirm-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.dark-theme .mobile-confirm-title {
    color: #fff;
}

.mobile-confirm-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

.dark-theme .mobile-confirm-message {
    color: #ccc;
}

.mobile-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mobile-confirm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 80px;
}

.mobile-confirm-btn.primary {
    background: #007bff;
    color: #fff;
}

.mobile-confirm-btn.primary:hover {
    background: #0056b3;
}

.mobile-confirm-btn.secondary {
    background: #6c757d;
    color: #fff;
}

.mobile-confirm-btn.secondary:hover {
    background: #545b62;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-app-header {
        height: 56px;
        padding: 0 12px;
    }
    
    .mobile-content {
        padding-top: 66px;
    }
    
    .mobile-page-title {
        font-size: 16px;
    }
    
    .mobile-back-btn,
    .mobile-header-action {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Hide scrollbars in mobile app mode */
body.mobile-app-mode::-webkit-scrollbar {
    display: none;
}

body.mobile-app-mode {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Prevent zoom on input focus */
input, select, textarea {
    font-size: 16px !important;
}

/* Mobile-specific button styles */
.btn-mobile {
    min-height: 44px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 500;
}

/* Mobile card styles */
.mobile-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 16px;
}

.dark-theme .mobile-card {
    background: #1a1a1a;
    border: 1px solid #333;
}

/* Mobile form styles */
.mobile-form-group {
    margin-bottom: 20px;
}

.mobile-form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 16px;
    font-size: 16px;
    min-height: 44px;
}

.mobile-form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.dark-theme .mobile-form-control {
    background: #333;
    border-color: #555;
    color: #fff;
}

.dark-theme .mobile-form-control:focus {
    border-color: #007bff;
}
