/* ============================================
   RESET & BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Source Sans Pro', Helvetica, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Prevent pull-to-refresh interference */
body {
    overscroll-behavior-y: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--gray);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.hidden { display: none !important; }
.visible { display: block; }  /* No !important to avoid conflicts with table-row display */

/* Form input improvements - prevent iOS zoom on focus */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="month"],
select,
textarea {
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

/* Better date/time inputs */
input[type="date"],
input[type="time"],
input[type="month"] {
    min-height: 44px;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Touch Action Optimization */
.btn,
.nav-link,
.card,
.entry-card,
.recent-project-btn,
.mobile-action-btn,
.burger-menu {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on interactive elements */
.btn,
.nav-link,
.burger-menu,
.mobile-action-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* Improved focus states for accessibility */
.btn:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth scrolling with momentum on iOS */
.entries-container,
.modal-content,
.detail-table-container,
.tags-dropdown {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
