/* 
 * Base Styles for SorakaSync Django Application
 * Global resets, typography, and CSS custom properties
 */

/* ==========================================================================
   CSS Reset and Base Styles
   ========================================================================== */

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

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
    /* Colors */
    --primary-blue: #1e40af;
    --primary-blue-hover: #1d4ed8;
    --primary-blue-light: #dbeafe;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #374151;
    --gray-700: #1f2937;
    
    --red-50: #fef2f2;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    
    --yellow-50: #fefce8;
    --yellow-200: #fde047;
    --yellow-300: #fef3c7;
    --yellow-600: #d97706;
    --yellow-700: #92400e;
    
    --green-50: #dcfce7;
    --green-700: #166534;
    
    --pink-500: #ec4899;
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.125rem;    /* 2px */
    --spacing-sm: 0.25rem;     /* 4px */
    --spacing-md: 0.5rem;      /* 8px */
    --spacing-lg: 1rem;        /* 16px */
    --spacing-xl: 1.5rem;      /* 24px */
    --spacing-2xl: 2rem;       /* 32px */
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    --border-radius-xl: 12px;
    --border-radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 2px 10px rgba(0,0,0,0.1);
    
    /* Transitions */
    --transition-fast: all 0.2s;
    --transition-normal: all 0.3s;
}

/* ==========================================================================
   Base Typography and Body Styles
   ========================================================================== */

body {
    font-family: var(--font-family-base);
    background: var(--gray-50);
    color: #333;
    line-height: 1.6;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Flex Utilities */
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Spacing */
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }
.gap-2xl { gap: var(--spacing-2xl); }

/* Margins */
.m-0 { margin: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mb-2xl { margin-bottom: var(--spacing-2xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-2xl { margin-top: var(--spacing-2xl); }

/* Padding */
.p-0 { padding: 0; }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }
.p-2xl { padding: var(--spacing-2xl); }

/* Colors */
.text-primary { color: var(--primary-blue); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }

.bg-white { background: white; }
.bg-gray-50 { background: var(--gray-50); }
.bg-primary { background: var(--primary-blue); }

/* Border Radius */
.rounded-sm { border-radius: var(--border-radius-sm); }
.rounded-md { border-radius: var(--border-radius-md); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-full { border-radius: var(--border-radius-full); }

/* Font Weight */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Font Size */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Transitions */
.transition { transition: var(--transition-fast); }
.transition-normal { transition: var(--transition-normal); }

/* ==========================================================================
   Focus and Accessibility
   ========================================================================== */

/* Improved focus styles for accessibility
   Limit the default blue outline for interactive controls; modal status
   buttons use their own selected border styling. */
*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Remove blue focus ring from status buttons; they will rely on selected state */
.multiple-medication-administration-modal .status-btn:focus,
.administer-medication-modal .status-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Skip to content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}