/* Frontline Aide - Enhanced Stylesheet v2.0
 * Modern, accessible, and user-friendly design
 */

/* CSS Custom Properties for consistent theming */
:root {
    --primary-green: #2D5A3D;
    --sage-green: #7A9B7E;
    --soft-gold: #E6C79C;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Enhanced Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-light);
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { 
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

h2 { 
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1.25rem;
}

h3 { 
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
}

h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.25rem); }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* Enhanced Links */
a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #1F3D2A;
    text-decoration: underline;
}

/* Enhanced Navigation */
nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    position: relative;
    transition: var(--transition);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
}

.nav-link:hover {
    color: var(--primary-green);
    background: rgba(45, 90, 61, 0.1);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-green);
    background: rgba(45, 90, 61, 0.1);
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    .mobile-menu {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid var(--border-light);
        box-shadow: var(--shadow-lg);
    }
    
    .mobile-menu a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-light);
        transition: var(--transition);
        font-weight: 500;
    }
    
    .mobile-menu a:hover {
        background: var(--bg-light);
        color: var(--primary-green);
    }
    
    .mobile-menu .btn {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    min-height: 48px; /* Enhanced touch target */
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #1F3D2A;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--sage-green);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #5A7A5D;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    font-weight: 600;
}

.btn-outline:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--primary-green);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: rgba(45, 90, 61, 0.1);
    border-color: var(--primary-green);
    text-decoration: none;
}

/* Mobile Button Improvements */
@media (max-width: 768px) {
    .btn {
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .btn-group .btn {
        margin-bottom: 0;
        border-radius: 0;
    }
    
    .btn-group .btn:first-child {
        border-top-left-radius: var(--border-radius);
        border-top-right-radius: var(--border-radius);
    }
    
    .btn-group .btn:last-child {
        border-bottom-left-radius: var(--border-radius);
        border-bottom-right-radius: var(--border-radius);
    }
}

/* Enhanced Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--border-medium);
}

.card-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-light);
}

.card-body {
    padding: 2rem;
}

.card-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

/* Enhanced Service Cards */
.service-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-light);
}

.service-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
    border-color: var(--sage-green);
}

.service-card .icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
}

.service-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* Mobile Service Cards */
@media (max-width: 768px) {
    .service-card {
        margin-bottom: 2rem;
        padding: 1.5rem;
    }
    
    .service-card .icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .service-card h3 {
        font-size: 1.25rem;
    }
}

/* Enhanced Forms */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-white);
    font-family: var(--font-family);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(45, 90, 61, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.valid,
.form-select.valid,
.form-textarea.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.form-help {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Mobile Form Improvements */
@media (max-width: 768px) {
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1.125rem 1.25rem;
        border-width: 2px;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
}

/* Enhanced Hero Section */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--sage-green) 100%);
    color: white;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 600px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero .btn {
    font-size: 1.125rem;
    padding: 1rem 2.5rem;
    box-shadow: var(--shadow-md);
}

.hero .btn:hover {
    box-shadow: var(--shadow-xl);
}

/* Mobile Hero Improvements */
@media (max-width: 768px) {
    .hero {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero p {
        font-size: clamp(1rem, 4vw, 1.25rem);
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero .btn {
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 1rem auto;
        font-size: 1.125rem;
        padding: 1.125rem 2rem;
    }
}

/* Enhanced Testimonials */
.testimonial {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

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

.testimonial-content {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 2rem;
    position: relative;
    font-size: 1.125rem;
    line-height: 1.8;
}

.testimonial-content::before {
    content: '"';
    font-size: 4rem;
    color: var(--soft-gold);
    position: absolute;
    top: -1.5rem;
    left: -1rem;
    font-family: serif;
    opacity: 0.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sage-green), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    margin-right: 1.25rem;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
}

.testimonial-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.testimonial-role {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Mobile Testimonials */
@media (max-width: 768px) {
    .testimonial {
        padding: 2rem;
    }
    
    .testimonial-content {
        font-size: 1rem;
    }
    
    .testimonial-avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

/* Enhanced Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 4rem 0 2rem 0;
}

.footer-section h4 {
    color: var(--soft-gold);
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.125rem;
}

.footer-section a {
    color: #9CA3AF;
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--soft-gold);
    transform: translateX(4px);
    text-decoration: none;
}

.footer-section p {
    color: #9CA3AF;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: #6B7280;
    font-size: 0.9rem;
}

/* Mobile Footer */
@media (max-width: 768px) {
    footer {
        padding: 3rem 0 2rem 0;
    }
    
    .footer-section {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .footer-section h4 {
        margin-bottom: 1rem;
    }
    
    .footer-section a {
        padding: 0.75rem 0;
    }
}

/* Enhanced Admin Panel */
.admin-panel {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--sage-green);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile Admin Panel */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Enhanced Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.revealed:nth-child(odd) {
    transition-delay: 0.1s;
}

.scroll-reveal.revealed:nth-child(even) {
    transition-delay: 0.2s;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(45, 90, 61, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-green);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility Improvements */
:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

.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;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero,
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #F9FAFB;
        --text-light: #D1D5DB;
        --bg-light: #111827;
        --bg-white: #1F2937;
        --border-light: #374151;
        --border-medium: #4B5563;
    }
    
    body {
        background: var(--bg-light);
        color: var(--text-dark);
    }
    
    .card,
    .service-card,
    .testimonial {
        background: var(--bg-white);
        border-color: var(--border-light);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--sage-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

/* Utility Classes */
.text-primary { color: var(--primary-green); }
.text-sage { color: var(--sage-green); }
.text-gold { color: var(--soft-gold); }
.bg-primary { background-color: var(--primary-green); }
.bg-sage { background-color: var(--sage-green); }
.bg-gold { background-color: var(--soft-gold); }
.border-primary { border-color: var(--primary-green); }
.border-sage { border-color: var(--sage-green); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.rounded-sm { border-radius: var(--border-radius-sm); }
.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.transition { transition: var(--transition); }
.transition-fast { transition: var(--transition-fast); }

/* Spacing Utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Responsive Spacing */
@media (max-width: 768px) {
    .space-y-md-1 > * + * { margin-top: 0.25rem; }
    .space-y-md-2 > * + * { margin-top: 0.5rem; }
    .space-y-md-3 > * + * { margin-top: 0.75rem; }
    .space-y-md-4 > * + * { margin-top: 1rem; }
    .space-y-md-6 > * + * { margin-top: 1.5rem; }
    .space-y-md-8 > * + * { margin-top: 2rem; }
}