/* 移动端专用样式 - 司机管理系统 */

/* 基础移动端设置 */
@media (max-width: 768px) {
    /* 重置基础样式 */
    * {
        box-sizing: border-box;
    }
    
    body {
        font-size: 16px; /* 防止iOS缩放 */
        line-height: 1.5;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* 容器优化 */
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* 标题优化 */
    h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    /* 卡片移动端优化 */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-header {
        padding: 1rem;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }
    
    .card-header:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 折叠功能样式 */
    .collapse-icon {
        transition: transform 0.3s ease;
        font-size: 0.9rem;
    }
    
    .collapsed .collapse-icon {
        transform: rotate(-90deg);
    }
    
    /* 折叠动画优化 */
    .collapse {
        transition: all 0.3s ease;
    }
    
    .collapse:not(.show) {
        display: none;
    }
    
    .collapsing {
        height: 0;
        overflow: hidden;
        transition: height 0.35s ease;
    }
    
    /* 信息项移动端布局 */
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background-color: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e9ecef;
    }
    
    .info-label {
        flex: none;
        width: 100%;
        font-weight: 600;
        color: #495057;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    .info-value {
        flex: none;
        width: 100%;
        color: #212529;
        font-size: 1rem;
        word-break: break-word;
    }
    
    /* 记录显示移动端优化 */
    .call-record.completed {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .record-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .record-title {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    
    /* 徽章移动端优化 */
    .method-badge, .alcohol-badge {
        display: inline-block;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-radius: 25px;
        margin-top: 0.25rem;
    }
    
    /* 确认事项移动端优化 */
    .confirmation-items {
        gap: 0.75rem;
    }
    
    .confirmation-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* 表单移动端优化 */
    .call-form {
        padding: 0.75rem;
    }
    
    .form-label.fw-bold {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        color: #495057;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem;
        border-radius: 8px;
        border: 2px solid #e9ecef;
        min-height: 44px; /* 触摸友好 */
    }
    
    .form-control:focus, .form-select:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    }
    
    /* 方法选择移动端优化 */
    .method-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .method-options .form-check {
        flex: none;
        padding: 1rem;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        text-align: center;
        cursor: pointer;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        font-weight: 500;
    }
    
    .method-options .form-check:hover {
        border-color: #0d6efd;
        background-color: rgba(13, 110, 253, 0.05);
    }
    
    .method-options .form-check-input:checked + .form-check-label {
        color: #0d6efd;
        font-weight: 600;
    }
    
    /* 按钮移动端优化 */
    .btn {
        border-radius: 8px;
        font-weight: 600;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px; /* 触摸友好 */
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-lg {
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        min-height: 56px;
    }
    
    .btn:hover {
        transform: none; /* 移动端不需要悬停效果 */
    }
    
    /* 警告框移动端优化 */
    .alert {
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
    
    /* 车辆信息移动端优化 */
    .card.border-primary .card-body {
        padding: 1rem;
    }
    
    .card.border-primary .info-item {
        margin-bottom: 0.75rem;
    }
    
    /* 操作按钮移动端优化 */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .d-flex.justify-content-between .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 表单组移动端优化 */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* 文本域移动端优化 */
    textarea.form-control {
        min-height: 80px;
        font-size: 16px;
    }
    
    /* 复选框和单选框移动端优化 */
    .form-check {
        margin-bottom: 0.75rem;
        padding-left: 2rem;
    }
    
    .form-check-input {
        width: 20px;
        height: 20px;
        margin-left: -2rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
        line-height: 1.4;
        padding-top: 0.125rem;
    }
    
    /* 网格布局移动端优化 */
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .col-md-6 {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 1rem;
    }
    
    /* 导航栏移动端优化 - 与mobile_header_fix.css保持一致 */
    .navbar {
        padding: 0.75rem 1rem;
        overflow: hidden;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        min-height: 60px;
        background: linear-gradient(135deg, #0056b3, #007bff);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-brand {
        font-size: 1.2rem;
        max-width: 60%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 600;
        padding: 0.5rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    /* 导航栏容器溢出修复 */
    .navbar .container {
        max-width: 100%;
        width: 100%;
        padding: 0 0.5rem;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    /* 导航栏折叠菜单溢出修复 */
    .navbar-collapse {
        max-width: 100%;
        overflow: hidden;
        background: linear-gradient(135deg, rgba(0, 123, 255, 0.95), rgba(0, 86, 179, 0.95));
        backdrop-filter: blur(15px);
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .navbar-nav {
        max-width: 100%;
        overflow: hidden;
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0.75rem 1rem;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 500;
        border-radius: 8px;
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background-color: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .navbar-nav .nav-link i {
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
        color: rgba(255, 255, 255, 0.9);
    }
    
    /* 下拉菜单样式 */
    .dropdown-menu {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        border-radius: 8px;
        border: 1px solid rgba(0, 123, 255, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        margin-top: 0.5rem;
        padding: 0.5rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        border-radius: 6px;
        font-size: 0.95rem;
        font-weight: 500;
        color: #333;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: rgba(0, 123, 255, 0.1);
        color: #0056b3;
        transform: translateX(4px);
    }
    
    .dropdown-item i {
        font-size: 1rem;
        width: 18px;
        text-align: center;
        color: #666;
    }
    
    /* 页面间距优化 */
    .mt-4 {
        margin-top: 3rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    /* 滚动优化 */
    .card-body {
        max-height: none;
        overflow: visible;
    }
    
    /* 触摸优化 */
    input, select, textarea, button {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* 防止双击缩放 */
    * {
        touch-action: manipulation;
    }
    
    /* 移动端专用动画 */
    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .call-card {
        animation: slideInUp 0.3s ease-out;
    }
    
    /* 移动端状态指示器 */
    .status-indicator {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #28a745, #20c997);
        z-index: 9999;
    }
    
    /* 移动端快速操作按钮 */
    .quick-actions {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }
    
    .quick-action-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0d6efd, #0b5ed7);
        color: white;
        border: none;
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
    }
    
    /* 移动端加载状态 */
    .loading-spinner {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 2rem;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #0d6efd;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* 移动端错误提示 */
    .error-message {
        background-color: #f8d7da;
        color: #721c24;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        border: 1px solid #f5c6cb;
    }
    
    /* 移动端成功提示 */
    .success-message {
        background-color: #d4edda;
        color: #155724;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        border: 1px solid #c3e6cb;
    }
    
    /* 移动端信息提示 */
    .info-message {
        background-color: #d1ecf1;
        color: #0c5460;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        border: 1px solid #bee5eb;
    }
    
    /* 折叠功能增强 */
    .card-header[data-bs-toggle="collapse"] {
        user-select: none;
    }
    
    .card-header[data-bs-toggle="collapse"]:active {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    /* 折叠状态指示 */
    .card-header[aria-expanded="false"] .collapse-icon {
        transform: rotate(-90deg);
    }
    
    .card-header[aria-expanded="true"] .collapse-icon {
        transform: rotate(0deg);
    }
    
    /* 折叠内容动画 */
    .collapse.show {
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 移动端折叠优化 */
    .collapse:not(.show) {
        display: none !important;
    }
    
    /* 触摸反馈 */
    .card-header[data-bs-toggle="collapse"]:active {
        transform: scale(0.98);
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .card-header {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* 超小屏幕折叠优化 */
    .collapse-icon {
        font-size: 0.8rem;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 0 20px;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
    }
    
    .form-control, .form-select {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
    }
    
    /* 横屏折叠优化 */
    .card-header {
        padding: 0.5rem 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* 全局溢出修复 - 确保所有元素都不会溢出 */
@media (max-width: 768px) {
    /* 强制所有容器不溢出 */
    .container, .container-fluid {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* 强制所有行不溢出 */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    /* 强制所有列不溢出 */
    [class*="col-"] {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    /* 强制body和html不溢出 */
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    /* 强制所有文本元素不溢出 */
    h1, h2, h3, h4, h5, h6, p, span, div, a, button, input, select, textarea {
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        box-sizing: border-box !important;
    }
    
    /* 强制表单元素不溢出 */
    .form-control, .form-select, .btn {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* 强制卡片不溢出 */
    .card {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    #lbNext{
        width: 30px !important;
        height: 30px !important;
      }
    #lbPrev{
    width: 30px !important;
    height: 30px !important
    }
} 