/**
 * Arizona Physical Therapy - Custom Styles
 * Minimal custom CSS to complement Tailwind
 */

/* Custom Font Styles */
:root {
    --primary-blue: #2C5F8A;
    --light-blue: #5B9BD5;
    --dark-gray: #333333;
}

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

/* Focus Styles for Accessibility */
.keyboard-nav *:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Skip Link Styles */
.sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Form Field Error States */
input.error,
select.error,
textarea.error {
    border-color: #ef4444;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Custom Transitions */
a,
button {
    transition: all 0.3s ease;
}

/* Header Shadow Transition */
header {
    transition: box-shadow 0.3s ease;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

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

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

/* Card Hover Effects */
.hover\:shadow-xl {
    transition: box-shadow 0.3s ease;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Success Message Animation */
.success-message {
    animation: slideIn 0.3s ease-out;
}

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

/* Print Styles */
@media print {
    header,
    footer,
    .no-print,
    button,
    a[href^="tel:"],
    a[href^="mailto:"] {
        display: none !important;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
    
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* Responsive Image Containers */
.image-container {
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Scrollbar Styles (Webkit browsers) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--light-blue);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) #f3f4f6;
}

/* Ensure images maintain aspect ratio */
img {
    max-width: 100%;
    height: auto;
}

/* Utility Classes for 8pt Grid System */
.grid-8 {
    display: grid;
    gap: 8px;
}

.grid-16 {
    display: grid;
    gap: 16px;
}

.grid-24 {
    display: grid;
    gap: 24px;
}

.grid-32 {
    display: grid;
    gap: 32px;
}

/* Custom Button States */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

/* Responsive Typography Scale */
@media (max-width: 640px) {
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Ensure minimum touch target sizes for mobile */
@media (max-width: 768px) {
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
    }
}

/* Animation for FAQ accordions (if implemented) */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 1000px;
}

/* Custom focus visible styles for better accessibility */
:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure proper contrast for placeholder text */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Custom styles for form labels */
label {
    user-select: none;
}

/* Responsive table styles (if tables are added) */
@media (max-width: 640px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}