/* Main Styles for Bakery Production Tracker - Optimized for Bakery Workers */
:root {
    --primary: #f59e0b;
    --primary-light: #fef3c7;
    --primary-dark: #b45309;
    --background: #fff7ed;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.2);
    --card-border: #f59e0b;
}

/* Base styles with improved readability */
html {
    font-size: 18px; /* Larger base font size */
    touch-action: manipulation; /* Prevent double-tap zoom */
}

body {
    font-family: 'Arial', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background-color: #fefefe;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
}

/* Disable zoom on inputs */
input, select, button {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
    touch-action: manipulation;
}

/* Custom scrollbar - wider for touch */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Container styles */
.container {
    max-width: 1400px; /* Wider container for more space */
    margin: 0 auto;
    padding: 0.75rem;
}

/* Header styles - larger and more prominent */
header {
    background-color: white;
    box-shadow: 0 3px 6px var(--shadow);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary);
}

/* Navigation - larger buttons */
nav ul {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.nav-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

.nav-btn:hover {
    background-color: var(--primary-dark);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product card styles - optimized for touch */
.product-card {
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    background-color: white;
    border: 3px solid var(--card-border);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow);
    padding: 1rem;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px var(--shadow);
}

.product-card h3 {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

/* Quantity controls - larger for easier touch */
.product-card .flex {
    margin-bottom: 1rem;
}

.increment-btn, .decrement-btn, 
.writeoff-increment-btn, .writeoff-decrement-btn {
    background-color: var(--primary);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.product-quantity, .writeoff-quantity {
    font-size: 1.5rem !important;
    height: 3rem;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    width: 5rem !important;
}

.submit-output, .submit-writeoff {
    background-color: var(--primary);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1.1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Button styles */
.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Calendar styling */
.writeoff-calendar-day, .calendar-day {
    min-height: 40px;
    padding: 5px;
    text-align: center;
    position: relative;
    background-color: var(--background);
}

.empty-day {
    min-height: 40px;
    background-color: transparent;
}

.writeoff-calendar-day.has-data, .calendar-day.has-data {
    background-color: rgba(245, 158, 11, 0.1);
    font-weight: bold;
    border: 2px solid var(--primary);
}

.writeoff-calendar-day.selected, .calendar-day.selected {
    background-color: rgba(245, 158, 11, 0.3);
    font-weight: bold;
    border: 2px solid var(--primary-dark);
}

/* Toast notification */
#toast {
    z-index: 1000;
}

#toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Offline indicator */
.offline-indicator {
    background-color: #f87171;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* PWA install prompt */
#pwa-install-prompt {
    z-index: 50;
    max-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    html {
        font-size: 16px;
    }
    
    .nav-btn {
        min-width: auto;
        padding: 0.5rem 0.75rem;
    }
    
    header {
        flex-direction: column;
    }
    
    header > div {
        margin-bottom: 1rem;
    }
    
    .product-card {
        padding: 0.75rem;
    }
}

/* Animation for better UX */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Optimizations for PWA */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    user-select: text;
}