/* Main Application Styles */
/* Ravnix Tablet PWA */

:root {
    --primary-color: #fbbf24;
    --secondary-color: #1e293b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-bg: #f8fafc;
    --dark-bg: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background - Dark Navy */
.bg-gradient {
    background: #1a202c;
}

/* Logo */
.logo {
    filter: drop-shadow(var(--shadow));
}

/* App Card */
.app-card .card {
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.app-card .card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.app-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Connection Status Badge */
#connection-status {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    box-shadow: var(--shadow);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Sync Status */
.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--info-color);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.sync-status.syncing {
    background-color: var(--warning-color);
}

.sync-status.error {
    background-color: var(--danger-color);
}

.sync-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Touch-Optimized Buttons */
.btn-touch {
    min-height: 56px;
    min-width: 120px;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-touch:active {
    transform: scale(0.98);
}

/* Touch-Friendly Forms */
.form-control-touch {
    padding: 1rem;
    font-size: 1.125rem;
    min-height: 56px;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.form-control-touch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Camera Preview */
.camera-preview {
    width: 100%;
    max-width: 640px;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.camera-preview video {
    width: 100%;
    height: auto;
    display: block;
}

/* Scanner Container */
.scanner-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Job Card */
.job-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.job-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.job-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.job-card-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Status Colors */
.status-scheduled {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Part Item */
.part-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.part-item:active {
    background-color: #f8fafc;
    transform: scale(0.99);
}

.part-image {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    object-fit: cover;
    background-color: #f1f5f9;
}

.part-info {
    flex: 1;
}

.part-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.part-number {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Action Bar */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid var(--border-color);
    padding: 1.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 300px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

/* Pull to Refresh */
.pull-to-refresh {
    position: relative;
}

.ptr-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.ptr-indicator.pulling {
    top: 10px;
}

/* Utility Classes */
.text-muted {
    color: var(--text-secondary);
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* Responsive Image */
img {
    max-width: 100%;
    height: auto;
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
}
