/* Custom styles for Pulse */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Enhanced dropdown styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.dropdown-item i {
    width: 16px;
    flex-shrink: 0;
}

/* Enhanced navbar brand */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

/* Event cards styling */
.event-card {
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.event-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 123, 255, 0.3) !important;
}

.event-card .badge {
    font-size: 0.75rem;
}

.event-card h6 {
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

.event-content {
    line-height: 1.4;
    color: var(--bs-secondary-color);
}

/* Test event specific styling */
.event-card.border-warning {
    position: relative;
    border-width: 2px !important;
}

.event-card.border-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffc107, #fd7e14);
    border-radius: 4px 4px 0 0;
}

/* Test event badges */
.badge.bg-warning.text-dark {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: none;
}

/* Test notification success message styling */
.alert-success small.text-muted {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Spinning refresh icon */
.spin {
    animation: spin 1s linear infinite;
}

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

/* Enhanced accordion styling */
.accordion {
    --bs-accordion-border-radius: 12px;
    --bs-accordion-border-color: rgba(255, 255, 255, 0.1);
}

.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
    overflow: hidden;
}

.accordion-button {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--bs-body-color);
    font-weight: 500;
    padding: 1rem 1.25rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.accordion-button::after {
    filter: brightness(0) invert(1);
}

.accordion-button:not(.collapsed)::after {
    filter: none;
}

.accordion-body {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* iOS PWA Installation Styling */
.installation-steps .step-item {
    align-items: flex-start;
}

.installation-steps .step-number {
    background: var(--bs-primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-right: 1rem;
    margin-top: 0.125rem;
}

.installation-steps .step-content {
    flex: 1;
}

.installation-steps .step-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--bs-body-color);
}

/* iOS Modal Header Dark Theme Fix */
body.ios-device .modal-header {
    background: unset !important;
    border-bottom-color: var(--bs-border-color);
}

/* Enhanced alert styling for installation modal */
.modal-body .alert {
    border: none;
    border-radius: 8px;
}

.modal-body .alert-info {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 4px solid var(--bs-info);
}

.modal-body .alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--bs-warning);
}

/* iOS PWA Installation Banner */
/* Safe area support for iPhone notch - iOS only */
body.ios-device {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* iOS standalone mode styling - Only for iOS in standalone mode */
@media (display-mode: standalone) {
    body.ios-device {
        padding-top: max(env(safe-area-inset-top), 20px);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Prevent bounce scrolling on iOS */
    body.ios-device {
        overflow-x: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    body.ios-device main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* iOS-specific notification UI - Only show on iOS devices */
body.ios-device .ios-install-banner {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    animation: slideInDown 0.5s ease-out;
}

body.ios-device .notification-setup-card.ios-required {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced notification cards */
.notification-setup-card {
    border: 1px solid;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.notification-setup-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

/* iOS instruction steps - Only for iOS devices */
body.ios-device .ios-steps {
    counter-reset: step-counter;
}

body.ios-device .ios-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 40px;
    margin-bottom: 15px;
}

body.ios-device .ios-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #007bff;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* PWA install prompt styling */
.pwa-install-prompt {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.3);
}

.pwa-install-prompt .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.pwa-install-prompt .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* iOS Safari share icon - Only for iOS devices */
body.ios-device .safari-share-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #007bff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath d='M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5z'/%3E%3C/svg%3E") center/contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath d='M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5z'/%3E%3C/svg%3E") center/contain;
}

/* Enhanced toast styling for iOS devices */
body.ios-device #toast-container .toast {
    border-radius: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* iOS device frame simulation for instructions */
.ios-device-frame {
    width: 200px;
    height: 400px;
    background: #000;
    border-radius: 25px;
    padding: 20px 10px;
    margin: 0 auto;
    position: relative;
}

.ios-device-frame::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

.ios-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Enhanced button styling for iOS devices */
body.ios-device .btn-ios {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

body.ios-device .btn-ios:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: white;
}

body.ios-device .btn-ios:active {
    transform: translateY(0);
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-indicator.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.status-indicator.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Pulse loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* iOS-specific modal enhancements */
body.ios-device .modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

/* Ensure modal headers inherit theme correctly on iOS */
body.ios-device .modal-header {
    background: unset !important;
    border-bottom: unset !important;
}

/* Enhanced accessibility for iOS */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .notification-setup-card {
        border-width: 3px;
    }
    
    .btn-ios {
        border: 2px solid #000;
    }
}

/* Recent Events Section Highlighting */
.card.border-primary {
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.15);
    transition: box-shadow 0.15s ease-in-out;
}

.card.border-primary:hover {
    box-shadow: 0 0.375rem 0.75rem rgba(13, 110, 253, 0.2);
}

.bg-primary.bg-opacity-10 {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Subscription Tier Information Section */
.card.border-info {
    box-shadow: 0 0.25rem 0.5rem rgba(13, 202, 240, 0.15);
    transition: all 0.15s ease-in-out;
}

.card.border-info:hover {
    box-shadow: 0 0.375rem 0.75rem rgba(13, 202, 240, 0.2);
}

.bg-info.bg-opacity-10 {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

/* Feature list styling in tier info */
#subscription-tier-info .list-unstyled li {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#subscription-tier-info .list-unstyled li:last-child {
    border-bottom: none;
}

/* Upgrade card hover effects */
#subscription-tier-info .card.border-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
    transition: all 0.2s ease;
}

/* Badge styling in tier section */
#subscription-tier-info .badge {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Billing Page Enhancements */
.feature-item {
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark mode hover shadow adjustment */
[data-bs-theme="dark"] .feature-item:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.plan-visual {
    border: 2px dashed var(--bs-primary);
    border-radius: 1rem;
    /* Remove fixed background - let Bootstrap handle it */
}

.price-display {
    margin-bottom: 1rem;
}

.features-list .feature-item {
    border-left: 4px solid transparent;
}

.features-list .bg-success {
    border-left-color: var(--bs-success);
}

.features-list .bg-warning {
    border-left-color: var(--bs-warning);
}

.features-list .bg-info {
    border-left-color: var(--bs-info);
}

.features-list .bg-primary {
    border-left-color: var(--bs-primary);
}

.features-list .bg-danger {
    border-left-color: var(--bs-danger);
}

.hero-section {
    background: var(--bs-primary);
    min-height: 200px;
    display: flex;
    align-items: center;
}

/* Billing card animations */
.billing-page .card {
    transition: all 0.3s ease;
}

.billing-page .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Dark mode card hover adjustment */
[data-bs-theme="dark"] .billing-page .card:hover {
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

/* Feature icon animations */
.feature-icon i {
    transition: all 0.2s ease;
}

.feature-item:hover .feature-icon i {
    transform: scale(1.1);
}

/* Accordion custom styling - respect Bootstrap themes */
.accordion-button:not(.collapsed) {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Recommended plan highlight - theme aware */
.border-warning[style*="border-width: 2px"] {
    box-shadow: 0 0 20px rgba(var(--bs-warning-rgb), 0.3);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 0 20px rgba(var(--bs-warning-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(var(--bs-warning-rgb), 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(var(--bs-warning-rgb), 0.3);
    }
}

/* Department badge styling in subscription list */
.badge i {
    font-size: 0.9em;
}