/* Diverticulitis Tracker - Modern Minimalistic Design */

/* Global Variables */
:root {
    --primary-color: #2563EB;
    --primary-hover: #1E40AF;
    --secondary-color: #64748B;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navigation */
.nav-link {
    display: inline-block;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Cards - Modern Minimalistic */
.card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Buttons - Flat Modern Design */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9375rem;
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9375rem;
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Forms - Clean Modern Input Fields */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
    letter-spacing: 0.01em;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Alerts - Minimal Style */
.alert-success {
    background-color: #ECFDF5;
    border-left: 4px solid var(--success-color);
    color: #065F46;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.alert-error {
    background-color: #FEF2F2;
    border-left: 4px solid var(--danger-color);
    color: #991B1B;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.alert-warning {
    background-color: #FFFBEB;
    border-left: 4px solid #F59E0B;
    color: #92400E;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Metric Cards - Subtle Gradient */
.metric-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Range Sliders - Modern Style */
input[type="range"] {
    width: 100%;
    height: 0.375rem;
    background: var(--border-color);
    outline: none;
    border-radius: 0.5rem;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Tables - Clean Design */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    font-weight: 600;
    text-align: left;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background-color: var(--bg-secondary);
}

/* Typography Improvements */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-muted {
    color: var(--text-muted);
}

/* Loading States - Smooth */
.htmx-request {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Modal Improvements */
.fixed.inset-0 {
    backdrop-filter: blur(4px);
}

/* Hover Effects for Interactive Elements */
button:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        min-width: auto;
    }

    .card {
        padding: 1.25rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .nav-link {
        padding: 0.5rem 0.5rem;
    }

    .card {
        padding: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
