/* Mobile-Responsive Optimizations for Tasks and Time Entry Pages */

/* Common Mobile Styles */
.mobile-tasks-page,
.mobile-timeentry-page {
    padding: 16px;
    max-width: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5;
}

/* Mobile Header */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header i {
    font-size: 1.3rem;
}

.mobile-actions {
    display: flex;
    gap: 8px;
}

/* Touch-Optimized Buttons */
.mobile-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    font-size: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.1s, box-shadow 0.1s;
}

.mobile-btn:active {
    transform: scale(0.95);
}

/* Loading State */
.mobile-loading {
    text-align: center;
    padding: 60px 20px;
}

.mobile-loading p {
    margin-top: 16px;
    color: #6c757d;
    font-size: 1rem;
}

/* Mobile Stats Cards */
.mobile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-card i {
    font-size: 2rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

/* Stat Card Color Variants */
.stat-total i { color: #007bff; }
.stat-active i { color: #28a745; }
.stat-pending i { color: #ffc107; }
.stat-completed i { color: #17a2b8; }

/* Mobile Filters */
.mobile-filters {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-row {
    display: flex;
    gap: 8px;
}

.filter-row .mobile-input {
    flex: 1;
}

.filter-row .mobile-btn {
    flex-shrink: 0;
}

.mobile-input {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 12px;
}

.mobile-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Mobile Task/Entry Lists */
.mobile-task-list,
.mobile-timeentry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Mobile Cards */
.mobile-task-card,
.mobile-timeentry-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: pan-y;
}

.mobile-task-card:active,
.mobile-timeentry-card:active {
    transform: scale(0.98);
}

.mobile-task-card.swipe-active,
.mobile-timeentry-card.swipe-active {
    transform: translateX(var(--swipe-offset, 0));
}

/* Card Header */
.task-card-header,
.entry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.task-id,
.entry-id {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
}

/* Card Title */
.task-title,
.entry-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Card Meta Information */
.task-meta,
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #6c757d;
}

.meta-item i {
    font-size: 1rem;
}

/* Entry Project */
.entry-project {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #007bff;
    margin-top: 8px;
    padding: 8px;
    background: #f0f8ff;
    border-radius: 6px;
}

/* Swipe Actions */
.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-task-card.swipe-active .swipe-actions,
.mobile-timeentry-card.swipe-active .swipe-actions {
    transform: translateX(0);
}

.action-btn {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 44px;
}

.action-btn i {
    font-size: 1.25rem;
}

.action-view {
    background: #007bff;
}

.action-view:active {
    background: #0056b3;
}

.action-edit {
    background: #28a745;
}

.action-edit:active {
    background: #1e7e34;
}

/* Empty State */
.mobile-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mobile-empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 16px;
}

.mobile-empty-state p {
    font-size: 1rem;
    color: #6c757d;
}

/* Pull to Refresh Indicator */
.pull-to-refresh-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #007bff;
    z-index: 1000;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pull-to-refresh-indicator.active {
    top: 20px;
}

.pull-to-refresh-indicator i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Touch Feedback */
.mobile-task-card,
.mobile-timeentry-card,
.mobile-btn,
.stat-card {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* Responsive Breakpoints */
@media (max-width: 375px) {
    .mobile-stats {
        grid-template-columns: 1fr;
    }
    
    .mobile-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .mobile-header h1 {
        text-align: center;
        justify-content: center;
    }
    
    .mobile-actions {
        justify-content: center;
    }
}

@media (min-width: 768px) {
    /* Hide mobile pages on tablet/desktop */
    .mobile-tasks-page,
    .mobile-timeentry-page {
        display: none;
    }
}

/* Prevent zoom on double-tap */
* {
    touch-action: manipulation;
}

/* Accessibility */
.mobile-task-card:focus,
.mobile-timeentry-card:focus,
.mobile-btn:focus,
.action-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .mobile-tasks-page,
    .mobile-timeentry-page {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* Smooth scrolling */
.mobile-task-list,
.mobile-timeentry-list {
    -webkit-overflow-scrolling: touch;
}

/* Badge Styling */
.badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
}
