/* ===============================================================================
   Parables Website - Custom CSS Styles
   This file contains custom styles to complement Tailwind CSS
   Compatible with all modern browsers and mobile devices
   =============================================================================== */

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Parable Card Styles */
.parable-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 2px solid;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    max-width: 100%;
    box-sizing: border-box;
}

.parable-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.parable-card:active {
    transform: translateY(2px) scale(0.98);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

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

/* Modal Styles */
.modal-backdrop {
    backdrop-filter: blur(8px);
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.dark ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Loading Animation */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

/* Text Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: inherit;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.3);
    color: inherit;
}

/* Focus Styles */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .parable-card {
        margin: 0 auto 1rem auto;
        width: 100%;
        max-width: calc(100vw - 2rem);
        min-height: 120px;
        padding: 1rem;
    }
    
    .parable-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    /* Ensure grid items don't overflow */
    #parables-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    /* Modal adjustments for mobile */
    #parable-modal > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 640px) {
    .parable-card {
        padding: 0.75rem;
        min-height: 100px;
    }
    
    .parable-card h3 {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .parable-card p {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .parable-card {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .parable-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    #parable-modal {
        display: none !important;
    }
}

/* Custom font loading */
@font-face {
    font-family: 'Gabriela';
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    font-display: swap;
}

/* Utility classes for dynamic content */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.bounce-in {
    animation: bounceIn 0.3s ease-out;
}

/* Gospel reference styling */
.gospel-reference {
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9em;
}

/* Content formatting */
.parable-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.parable-content p:last-child {
    margin-bottom: 0;
}

/* Responsive text sizing */
@media (max-width: 640px) {
    .font-gabriela {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
}

/* Accessibility improvements */
.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;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

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

/* Ensure proper spacing and centering */
.parable-card h3,
.parable-card p {
    text-align: center;
    width: 100%;
}

/* Grid container improvements */
#parables-grid {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive grid adjustments */
@media (min-width: 768px) {
    #parables-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #parables-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

