/* S.I.G.A.P-AI Mobile App Styles */
/* Optimized for Mobile Devices */

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

:root {
    /* Colors */
    --primary-blue: #2563EB;
    --primary-blue-dark: #1E40AF;
    --success-green: #10B981;
    --warning-yellow: #F59E0B;
    --danger-red: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Layout */
    --top-bar-height: 56px;
    --bottom-nav-height: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    touch-action: pan-y;
}

.mobile-app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.mobile-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--gray-50);
}

/* ========================================
   TOP BAR
   ======================================== */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: var(--primary-blue);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 var(--spacing-md);
    max-width: 480px;
    margin: 0 auto;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.top-bar-time {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ========================================
   SCREEN CONTAINER
   ======================================== */

.screen-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: var(--top-bar-height);
    margin-bottom: var(--bottom-nav-height);
    -webkit-overflow-scrolling: touch;
}

.screen {
    display: none;
    min-height: calc(100vh - var(--top-bar-height) - var(--bottom-nav-height));
}

.screen.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

.screen-content {
    padding: var(--spacing-md);
    padding-bottom: var(--spacing-xl);
}

.screen-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   HOME SCREEN
   ======================================== */

.greeting-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    padding: var(--spacing-lg);
    border-radius: 1rem;
    margin-bottom: var(--spacing-lg);
}

.greeting-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.greeting-subtitle {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
}

.greeting-date {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card.stat-total .stat-icon {
    background: #DBEAFE;
    color: var(--primary-blue);
}

.stat-card.stat-completed .stat-icon {
    background: #D1FAE5;
    color: var(--success-green);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title svg {
    color: var(--primary-blue);
}

.pending-count {
    background: var(--warning-yellow);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: auto;
}

/* Next Meeting Card */
.next-meeting-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-blue);
}

.meeting-time {
    text-align: center;
    padding: var(--spacing-sm);
    background: var(--gray-50);
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.meeting-time-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1;
}

.meeting-time-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    font-weight: 600;
    margin-top: 0.25rem;
}

.meeting-info {
    flex: 1;
}

.meeting-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

.meeting-room {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.meeting-room svg {
    color: var(--gray-400);
}

.meeting-deadline {
    font-size: 0.75rem;
    color: var(--warning-yellow);
    font-weight: 600;
}

/* Task Preview List */
.task-preview-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.task-preview-item {
    background: white;
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.task-preview-item:active {
    transform: scale(0.98);
}

.task-preview-info {
    flex: 1;
}

.task-preview-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.task-preview-room {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.task-preview-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.task-preview-badge.pending {
    background: var(--gray-200);
    color: var(--gray-700);
}

.task-preview-badge.progress {
    background: #FEF3C7;
    color: var(--warning-yellow);
}

/* ========================================
   TASKS SCREEN
   ======================================== */

.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    background: white;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

.filter-tab.active {
    background: var(--primary-blue);
    color: white;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.task-item {
    background: white;
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.task-item:active {
    transform: scale(0.98);
}

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-sm);
}

.task-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.task-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.task-badge.pending {
    background: var(--gray-200);
    color: var(--gray-700);
}

.task-badge.progress {
    background: #FEF3C7;
    color: #D97706;
}

.task-badge.completed {
    background: #D1FAE5;
    color: var(--success-green);
}

.task-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: var(--spacing-sm);
}

.task-meta-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.task-meta-row svg {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}

.task-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--gray-100);
}

.task-type {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
}

.task-deadline {
    font-size: 0.75rem;
    color: var(--danger-red);
    font-weight: 600;
}

/* ========================================
   TASK DETAIL SCREEN
   ======================================== */

.back-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
    border: none;
    background: none;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: var(--spacing-lg);
    font-family: var(--font-family);
}

.task-detail-header {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 0.75rem;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.task-detail-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

.task-detail-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.task-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.task-info-label {
    color: var(--gray-500);
    font-weight: 500;
}

.task-info-value {
    color: var(--gray-900);
    font-weight: 600;
}

/* Checklist */
.checklist-section {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 0.75rem;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.checklist-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.checklist-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 0.375rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checklist-checkbox.checked {
    background: var(--success-green);
    border-color: var(--success-green);
}

.checklist-checkbox svg {
    display: none;
    color: white;
    width: 16px;
    height: 16px;
}

.checklist-checkbox.checked svg {
    display: block;
}

.checklist-label {
    font-size: 0.9375rem;
    color: var(--gray-900);
    font-weight: 500;
}

/* Photo Evidence */
.photo-evidence-section {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 0.75rem;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.photo-evidence-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
}

.photo-upload-button {
    width: 100%;
    padding: var(--spacing-lg);
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

.photo-upload-button:active {
    transform: scale(0.98);
}

.photo-upload-button svg {
    width: 48px;
    height: 48px;
    color: var(--primary-blue);
}

.photo-upload-button span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photo-remove svg {
    width: 14px;
    height: 14px;
    color: white;
}

/* Action Buttons */
.task-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: var(--spacing-md);
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: var(--success-green);
    color: white;
}

.btn-primary:active {
    background: #059669;
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-secondary:active {
    background: var(--gray-50);
    transform: scale(0.98);
}

/* ========================================
   REPORT SCREEN
   ======================================== */

.report-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.report-item {
    background: white;
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.report-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-sm);
}

.report-item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.report-status {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    background: #D1FAE5;
    color: var(--success-green);
}

.report-meta {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-sm);
}

.report-photos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    margin-top: var(--spacing-sm);
}

.report-photo {
    aspect-ratio: 1;
    border-radius: 0.375rem;
    overflow: hidden;
}

.report-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   PROFILE SCREEN
   ======================================== */

.profile-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: 0.75rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    color: var(--primary-blue);
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.profile-role {
    font-size: 0.9375rem;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-unit {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.profile-stat-item {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.profile-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.profile-button {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all 0.2s ease;
}

.profile-button:active {
    transform: scale(0.98);
}

.profile-button.danger {
    border-color: var(--danger-red);
    color: var(--danger-red);
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: var(--spacing-sm);
    padding-bottom: var(--safe-area-bottom);
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border: none;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    font-family: var(--font-family);
    transition: color 0.2s ease;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 0.6875rem;
    font-weight: 600;
}

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

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 1rem 1rem 0 0;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-body {
    padding: var(--spacing-lg);
}

.camera-button {
    width: 100%;
    padding: var(--spacing-xl);
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    font-family: var(--font-family);
    color: var(--primary-blue);
    transition: all 0.2s ease;
}

.camera-button:active {
    transform: scale(0.98);
}

.camera-button span {
    font-size: 1rem;
    font-weight: 600;
}

.photo-preview {
    margin-top: var(--spacing-lg);
}

.photo-preview img {
    width: 100%;
    border-radius: 0.75rem;
}

/* ========================================
   RESPONSIVE (Max container width)
   ======================================== */

@media (min-width: 481px) {
    .mobile-container {
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    
    .top-bar,
    .bottom-nav {
        max-width: 480px;
        margin: 0 auto;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray-400);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9375rem;
    font-weight: 500;
}
