/* 
 * Quiltly Main Styles
 * Optimized for older users with accessibility in mind
 */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* CSS Custom Properties for easy theming */
:root {
    --primary-color: #6f42c1;
    --primary-light: #8f64d4;
    --primary-dark: #5a34a1;
    --secondary-color: #fd7e14;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* Text sizes - more compact */
    --base-font-size: 16px;
    --small-font-size: 14px;
    --large-font-size: 18px;
    --heading-size-h1: 2.5rem;
    --heading-size-h2: 2rem;
    --heading-size-h3: 1.5rem;
    
    /* Spacing - more compact */
    --section-padding: 3rem 0;
    --card-padding: 1.5rem;
    --button-padding: 0.5rem 1rem;
    
    /* Border radius - less rounded */
    --border-radius: 0.25rem;
    --border-radius-large: 0.5rem;
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Base styles */
* {
    box-sizing: border-box;
}

html {
    font-size: var(--base-font-size);
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    font-weight: 400;
    color: var(--dark-color);
    background-color: #ffffff;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--dark-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 10000;
    font-weight: 600;
}

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

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: var(--heading-size-h1); }
h2 { font-size: var(--heading-size-h2); }
h3 { font-size: var(--heading-size-h3); }

p, li, td, th {
    font-size: 1rem;
    line-height: 1.5;
}

/* Button improvements - more compact */
.btn {
    font-size: 1rem;
    font-weight: 600;
    padding: var(--button-padding);
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px; /* Touch target size */
    min-width: 38px;
}

.btn:hover, .btn:focus {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.btn:focus {
    outline: 3px solid rgba(111, 66, 193, 0.5);
    outline-offset: 2px;
}

.btn-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
}

/* Card improvements - less bubbly */
.card {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.card-body {
    padding: var(--card-padding);
}

/* Navigation improvements - more compact */
.navbar {
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-large);
    padding: 0.5rem 0;
}

.dropdown-item {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--primary-color);
    color: white;
}

/* Hero section - more compact */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.min-vh-50 {
    min-height: 40vh;
}

/* Feature cards - more compact */
.feature-icon {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form improvements */
.form-control, .form-select {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    min-height: 44px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.25);
}

.form-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Alert improvements */
.alert {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-large);
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Footer */
footer {
    font-size: 1rem;
}

footer h5, footer h6 {
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --base-font-size: 16px;
        --heading-size-h1: 2.5rem;
        --heading-size-h2: 2rem;
        --heading-size-h3: 1.75rem;
    }
    
    .hero-section {
        min-height: 60vh;
        padding: 3rem 0;
    }
    
    .btn-lg {
        font-size: 1.2rem;
        padding: 0.875rem 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.75rem !important;
    }
}

/* Focus indicators for better accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus, .btn:focus {
    outline: 3px solid rgba(111, 66, 193, 0.5);
}

/* High contrast mode support */
.high-contrast {
    --primary-color: #000000;
    --primary-light: #333333;
    --primary-dark: #000000;
    background-color: #ffffff;
    color: #000000;
}

.high-contrast .card {
    border: 2px solid #000000;
}

.high-contrast .btn-primary {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.high-contrast .btn-outline-primary {
    border-color: #000000;
    color: #000000;
}

.high-contrast .btn-outline-primary:hover {
    background-color: #000000;
    color: #ffffff;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Utility classes */
.text-large {
    font-size: 1.3rem;
}

.text-xl {
    font-size: 1.5rem;
}

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

.rounded-custom {
    border-radius: var(--border-radius-large);
}

/* Print styles */
@media print {
    .navbar, footer, .btn {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}
