/* Custom CSS for Church Engagement App */

/* Church branding variables - these will be overridden by inline styles */
:root {
    --church-primary: #6c5ce7;
    --church-secondary: #74b9ff;
    --church-gradient: linear-gradient(135deg, var(--church-primary), var(--church-secondary));
}

/* Custom church-specific button styles */
.btn-church-primary {
    background-color: var(--church-primary);
    border-color: var(--church-primary);
    color: white;
}

.btn-church-primary:hover,
.btn-church-primary:focus,
.btn-church-primary:active {
    background-color: var(--church-primary);
    border-color: var(--church-primary);
    opacity: 0.9;
    color: white;
}

/* Church-themed backgrounds */
.bg-church-primary {
    background-color: var(--church-primary) !important;
}

.bg-church-secondary {
    background-color: var(--church-secondary) !important;
}

.bg-gradient {
    background: var(--church-gradient) !important;
}

/* Text colors */
.text-church-primary {
    color: var(--church-primary) !important;
}

.text-church-secondary {
    color: var(--church-secondary) !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Audio player enhancements */
.audio-player {
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.audio-player:hover {
    background-color: #f8f9fa !important;
}

.play-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Progress bar customization */
.progress {
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Video container responsiveness */
.ratio iframe {
    border-radius: 0.375rem;
}

/* Prayer wall specific styles */
.prayer-card .card {
    border-left: 4px solid var(--church-primary);
}

.prayer-card .pray-btn.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

/* Event card styling */
.event-card .card.border-success {
    border-left: 4px solid #28a745 !important;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .display-6 {
        font-size: 1.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm > .btn,
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.775rem;
    }
    
    /* Mobile navigation improvements */
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
    
    /* Better spacing on mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Search and filter enhancements */
.input-group-text {
    background-color: var(--bs-light);
    border: 1px solid var(--bs-border-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--church-primary);
    box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.25);
}

/* Badge styling */
.badge {
    font-size: 0.7em;
    font-weight: 500;
}

/* Audio progress styling */
audio::-webkit-media-controls-panel {
    background-color: var(--bs-light);
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-pause-button {
    background-color: var(--church-primary);
    border-radius: 50%;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--church-secondary);
}

/* Animation for new content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.devotional-card,
.sermon-card,
.event-card,
.prayer-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .d-print-none {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .container {
        max-width: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-church-primary {
        background-color: #000;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card,
    .btn,
    .progress-bar,
    .devotional-card,
    .sermon-card,
    .event-card,
    .prayer-card {
        transition: none;
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus indicators for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--church-primary);
    outline-offset: 2px;
}

/* Custom toast positioning */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* Loading placeholder animation */
.placeholder-glow .placeholder {
    animation: placeholder-glow 2s ease-in-out infinite alternate;
}

@keyframes placeholder-glow {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Church logo styling */
.navbar-brand img {
    border-radius: 4px;
    object-fit: contain;
}

/* Quick action cards */
.quick-action-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-card:hover {
    background-color: var(--church-primary);
    color: white;
}

.quick-action-card:hover i {
    color: white;
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Character counter styling */
.form-text.text-danger {
    font-weight: bold;
}

/* YouTube embed improvements */
.ratio iframe {
    border: none;
    border-radius: 0.375rem;
}

/* Prayer wall specific animations */
.prayer-card.new-prayer {
    animation: pulseGlow 2s ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(108, 92, 231, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(108, 92, 231, 0.6);
    }
}

/* Enhanced button states */
.btn-church-primary:active {
    transform: translateY(1px);
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 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 for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--church-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}
