/* Custom CSS for The Florida Psychiatric Center Website */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #2C5F8D;
    --secondary-color: #555354;
    --accent-color: #4CAF50;
    --gray-light: #f7f7f7;
    --gray-medium: #e5e5e5;
    --white: #ffffff;
    --black: #000000;
    
    /* Spacing based on 8pt grid */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --space-12: 96px;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Ensure minimum touch target size for mobile */
button, 
a, 
input[type="submit"], 
input[type="button"], 
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

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

/* Skip to main content link for accessibility */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

/* Custom dropdown animation */
.group:hover .group-hover\:opacity-100 {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero section overlay gradient */
.hero-overlay {
    background: linear-gradient(135deg, rgba(44, 95, 141, 0.95) 0%, rgba(44, 95, 141, 0.8) 100%);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Form styling enhancements */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    transition: border-color 0.2s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 141, 0.1);
}

/* Custom loading spinner */
.spinner {
    border: 3px solid rgba(44, 95, 141, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typography enhancements */
.font-display {
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Responsive image containers */
.img-container {
    position: relative;
    overflow: hidden;
    background-color: var(--gray-light);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.img-container:hover img {
    transform: scale(1.05);
}

/* Service card icon backgrounds */
.icon-bg-primary {
    background-color: rgba(44, 95, 141, 0.1);
}

.icon-bg-accent {
    background-color: rgba(76, 175, 80, 0.1);
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease;
}

#mobile-menu.hidden {
    max-height: 0;
    overflow: hidden;
}

#mobile-menu:not(.hidden) {
    max-height: 600px;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Print styles */
@media print {
    header nav,
    footer,
    .no-print {
        display: none;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-width: 2px !important;
    }
    
    button, 
    a {
        text-decoration: underline;
    }
}

/* Custom utilities for consistent spacing */
.section-padding {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.container-padding {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}

@media (min-width: 640px) {
    .container-padding {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
}

@media (min-width: 1024px) {
    .container-padding {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}