/* Custom CSS for PetForever */

/* Referral Call-to-Action Styling */
.referral-cta {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #e1bee7;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.1);
    transition: all 0.3s ease;
}

.referral-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.15);
}

.referral-cta .btn-primary {
    background: linear-gradient(45deg, #9c27b0, #673ab7);
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
    transition: all 0.3s ease;
}

.referral-cta .btn-primary:hover {
    background: linear-gradient(45deg, #8e24aa, #5e35b1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

:root {
    --primary-color: #8B5CF6;
    --secondary-color: #EC4899;
    --accent-color: #F59E0B;
    --memorial-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-muted: #6B7280;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Mobile-first responsive design */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents iOS zoom on input focus */
    border-radius: 8px;
    touch-action: manipulation;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.btn-sm {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.btn-lg {
    min-height: 48px;
    padding: 16px 24px;
    font-size: 18px;
}

/* Navigation - Mobile Optimized */
.navbar {
    padding: 12px 0;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-toggler {
    padding: 8px 12px;
    border: none;
    font-size: 18px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-nav .nav-link {
    padding: 12px 16px;
    font-size: 16px;
}

/* Timeline Media Elements */
.timeline-media {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: contain; /* Preserve aspect ratio without cropping */
    display: block;
    margin: 0 auto; /* Center the image */
}

/* Timeline Media Container Styling */
.timeline-image-container,
.timeline-video-container {
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    margin: 0 auto;
}

/* Preserve original aspect ratios for all timeline media */
.timeline-media {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: none; /* Remove all height restrictions */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: contain; /* Never crop images - preserve original aspect ratio */
    object-position: center;
    display: block;
    margin: 0 auto;
    background-color: transparent;
}

/* Video specific styling */
video.timeline-media {
    background-color: #000;
    outline: none;
    max-height: none; /* Remove height restrictions for videos too */
}

video.timeline-media:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Vertical photo support - ensure they display naturally */
.timeline-media[style*="portrait"], 
.timeline-media {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* This is key - never crops */
}

/* Timeline Edit Button Styling */
.edit-memory-btn {
    transition: all 0.2s ease;
}

.edit-memory-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Timeline Action Buttons Layout */
.timeline-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.timeline-buttons .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Mobile optimization for timeline buttons */
@media (max-width: 576px) {
    .timeline-buttons {
        gap: 4px;
    }
    
    .timeline-buttons .btn-sm {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .timeline-buttons .btn-text {
        display: none;
    }
}

/* Image Cropper Styles */
.crop-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.crop-canvas {
    display: block;
    cursor: grab;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.crop-canvas:active {
    cursor: grabbing;
}

.crop-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 15px;
}

.profile-image-preview {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.profile-image-preview img {
    border: 3px solid #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Responsive adjustments for crop modal */
@media (max-width: 768px) {
    .crop-controls {
        padding: 15px;
    }
    
    .crop-controls .row > div {
        margin-bottom: 15px;
    }
    
    .crop-controls .btn-group {
        width: 100%;
    }
    
    .crop-controls .btn {
        flex: 1;
    }
}

/* Mobile dropdown improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        margin-left: 16px;
        margin-top: 8px;
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 12px 16px;
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
}

/* Hero Section - Mobile Responsive */
.hero-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: 50vh;
        padding: 30px 0;
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
}

/* Feature Cards - Mobile Optimized */
.feature-card {
    background: white;
    border-radius: 15px;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    padding: 24px;
}

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

.feature-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .feature-card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .feature-icon {
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 2rem !important;
    }
}

/* Pet Cards - Mobile Enhanced */
.pet-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.pet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.pet-photo {
    border-radius: 0.375rem 0.375rem 0 0;
}

@media (max-width: 767.98px) {
    .pet-card {
        margin-bottom: 16px;
    }
    
    .pet-card .card-body {
        padding: 16px;
    }
    
    .pet-card .card-footer {
        padding: 12px 16px;
    }
    
    .pet-card .btn-group .btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Mobile-Friendly Forms */
.form-control,
.form-select {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom on input focus */
    border-radius: 8px;
    padding: 12px 16px;
}

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

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
}

/* Mobile spacing improvements */
@media (max-width: 767.98px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
}

/* Pet Profile Mobile Optimization */
@media (max-width: 767.98px) {
    .pet-name {
        font-size: 2rem;
    }
    
    .pet-portrait,
    .pet-portrait-placeholder {
        width: 150px;
        height: 150px;
    }
    
    .pet-hero {
        padding: 2rem 0;
        text-align: center;
    }
}

/* Enhanced Timeline Mobile Layout */
.timeline {
    padding: 0;
    margin: 0;
}

.timeline-item {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.timeline-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.timeline-item .card {
    border: none;
    box-shadow: none;
    background: transparent;
}

.timeline-item .card-body {
    padding: 0;
}

.timeline-item .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.timeline-item .card-text {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
}

.media-content {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
}

.timeline-media {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.timeline-media:hover {
    transform: scale(1.02);
}

.timeline-actions {
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: 16px;
}

.timeline-stats small {
    color: #94a3b8;
    font-size: 0.85rem;
}

.owner-actions .btn, .public-actions .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
}

/* Mobile Optimizations */
@media (max-width: 767.98px) {
    .timeline-item {
        margin-bottom: 16px;
        padding: 16px;
        border-radius: 12px;
    }
    
    .timeline-item .card-title {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .timeline-item .card-text {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .media-content {
        margin: 12px 0;
        border-radius: 8px;
    }
    
    .timeline-media {
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        object-fit: contain; /* Maintain aspect ratio on mobile */
    }
    
    .timeline-actions {
        padding-top: 12px;
        margin-top: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-actions .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    .timeline-buttons {
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .timeline-buttons .btn {
        font-size: 0.8rem;
        padding: 6px 8px;
        flex-shrink: 0;
        min-width: auto;
        white-space: nowrap;
        height: 32px;
        align-items: center;
        justify-content: center;
        display: inline-flex;
    }
    
    .timeline-buttons .btn .btn-text {
        display: none;
    }
    
    .timeline-buttons .btn .fas {
        margin: 0;
    }
}

/* Ultra-small screens (< 480px) */
@media (max-width: 479.98px) {
    .timeline-item {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .timeline-item .card-title {
        font-size: 0.95rem;
    }
    
    .timeline-item .card-text {
        font-size: 0.85rem;
    }
    
    .timeline-actions {
        padding-top: 8px;
        margin-top: 8px;
    }
    
    .owner-actions .btn, .public-actions .btn {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-width: 70px;
    }
}

/* Timeline Header */
.timeline-header {
    text-align: center;
    margin-bottom: 2rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    font-size: 0.9rem;
    color: #64748b;
}

/* Enhanced Timeline Actions */
.timeline-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 38px;
}

.share-count {
    display: flex;
    align-items: center;
    color: #94a3b8;
    font-weight: 500;
}

.share-toggle-btn, .copy-link-btn, .view-shared-btn {
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.share-toggle-btn:hover, .copy-link-btn:hover, .view-shared-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile Timeline Header */
@media (max-width: 767.98px) {
    .timeline-header {
        text-align: left;
        margin-bottom: 1.5rem;
    }
    
    .timeline-title {
        font-size: 1.3rem;
    }
    
    .timeline-subtitle {
        font-size: 0.85rem;
    }
    
    .timeline-buttons {
        gap: 6px;
        justify-content: flex-start;
    }
    
    .timeline-buttons .btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .btn-text {
        display: none;
    }
    
    .timeline-buttons .btn .fas {
        margin-right: 0 !important;
    }
}

/* Ultra-small screens button adjustments */
@media (max-width: 479.98px) {
    .timeline-buttons .btn {
        font-size: 0.75rem;
        padding: 5px 8px;
        min-width: 36px;
        justify-content: center;
    }
}

/* JIN Balance Mobile Optimization */
.jin-balance-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

@media (max-width: 767.98px) {
    .jin-balance-card {
        padding: 20px 16px;
        margin-bottom: 16px;
    }
    
    .jin-balance-card h3 {
        font-size: 1.5rem;
    }
}

/* Subscription Page Mobile Layout */
.pricing-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767.98px) {
    .pricing-card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .pricing-card .display-4 {
        font-size: 2rem;
    }
}

/* Card Input Mobile Styling */
.card-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Touch-friendly checkboxes and radios */
.form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.form-check-label {
    padding-left: 8px;
    line-height: 1.5;
}

/* Sticky footer on mobile */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 60px;
    }
    
    .mobile-bottom-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #dee2e6;
        padding: 12px 16px;
        z-index: 1000;
    }
}

/* Mobile-specific viewport fix */
.hero-section,
.full-height {
    height: 100vh; /* Fallback for older browsers */
    height: calc(var(--vh, 1vh) * 100);
}

/* Lazy loading placeholder */
img.lazy {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* PWA-style mobile header */
@media (max-width: 767.98px) {
    .mobile-header {
        background: white;
        border-bottom: 1px solid #dee2e6;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
}

/* Improved touch targets */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .dropdown-item,
    .card-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

.pet-photo {
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Mobile-friendly tables */
@media (max-width: 767.98px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
        vertical-align: middle;
    }
}

/* Safe area insets for newer mobile devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .mobile-bottom-actions {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

.memorial-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.memorial-overlay i {
    margin-right: 5px;
}

/* Pet Profile */
.pet-hero {
    /* Background will be set dynamically via inline styles based on user preference */
    color: white;
    padding: 3rem 0;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Enhanced text readability for different backgrounds */
.pet-hero .pet-name {
    font-weight: 700;
    margin-bottom: 8px;
}

.pet-hero .pet-breed {
    font-weight: 500;
    opacity: 0.95;
}

.pet-hero .badge {
    background-color: rgba(0,0,0,0.6) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.3);
    font-weight: 500;
}

.pet-hero small.text-muted {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
}

/* Specific contrast improvements for light backgrounds */
.pet-hero[style*="color: #2d3436"] .badge {
    background-color: rgba(45,52,54,0.8) !important;
    color: white !important;
}

.pet-hero[style*="color: #2d3436"] small.text-muted {
    color: rgba(45,52,54,0.7) !important;
}

/* Enhanced readability for action buttons in pet hero section */
.pet-hero .owner-actions .btn {
    background-color: rgba(255,255,255,0.95) !important;
    color: #2d3436 !important;
    border: 1px solid rgba(255,255,255,0.8) !important;
    font-weight: 600;
    text-shadow: none;
    backdrop-filter: blur(5px);
}

.pet-hero .owner-actions .btn:hover {
    background-color: rgba(255,255,255,1) !important;
    color: #2d3436 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Special styling for primary buttons */
.pet-hero .owner-actions .btn-outline-primary {
    background-color: rgba(13,110,253,0.9) !important;
    color: white !important;
    border-color: rgba(13,110,253,0.8) !important;
}

.pet-hero .owner-actions .btn-outline-primary:hover {
    background-color: rgba(13,110,253,1) !important;
    color: white !important;
}

/* Birthday Song button special styling */
.pet-hero .owner-actions .btn[style*="background: linear-gradient"] {
    color: #2d3436 !important;
    font-weight: 600;
    text-shadow: none;
    border: 2px solid rgba(255,215,0,0.8) !important;
}

.pet-hero .owner-actions .btn[style*="background: linear-gradient"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,215,0,0.3);
}

/* Light background specific adjustments */
.pet-hero[style*="color: #2d3436"] .owner-actions .btn {
    background-color: rgba(45,52,54,0.95) !important;
    color: white !important;
    border: 1px solid rgba(45,52,54,0.8) !important;
}

.pet-hero[style*="color: #2d3436"] .owner-actions .btn:hover {
    background-color: rgba(45,52,54,1) !important;
    color: white !important;
}

.pet-hero[style*="color: #2d3436"] .owner-actions .btn-outline-primary {
    background-color: rgba(13,110,253,0.9) !important;
    color: white !important;
    border-color: rgba(13,110,253,0.8) !important;
}

.pet-hero[style*="color: #2d3436"] .owner-actions .btn-outline-primary:hover {
    background-color: rgba(13,110,253,1) !important;
    color: white !important;
}

/* Enhanced readability for modal and card content */
.modal-content {
    backdrop-filter: blur(10px);
    background-color: rgba(255,255,255,0.98);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background-color: rgba(255,255,255,0.95);
}

.modal-body {
    background-color: rgba(255,255,255,0.98);
}

/* Card enhancements for better readability */
.card {
    backdrop-filter: blur(5px);
    background-color: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.1);
}

.card-header {
    background-color: rgba(0,123,255,0.95) !important;
    border-bottom: 1px solid rgba(0,123,255,0.2);
}

.card-body {
    background-color: rgba(255,255,255,0.98);
}

/* Alert components with better contrast */
.alert {
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.1);
}

.alert-success {
    background-color: rgba(25,135,84,0.15);
    border-color: rgba(25,135,84,0.3);
    color: #155724;
}

.alert-info {
    background-color: rgba(13,202,240,0.15);
    border-color: rgba(13,202,240,0.3);
    color: #0c5460;
}

.alert-warning {
    background-color: rgba(255,193,7,0.15);
    border-color: rgba(255,193,7,0.3);
    color: #664d03;
}

/* Form controls with better contrast */
.form-control, .form-select {
    background-color: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.2);
    backdrop-filter: blur(3px);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255,255,255,1);
    border-color: rgba(13,110,253,0.5);
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.15);
}

/* Button enhancements for all contexts */
.btn {
    font-weight: 600;
    backdrop-filter: blur(3px);
    border-width: 1px;
    text-shadow: none;
}

.btn-primary {
    background-color: rgba(13,110,253,0.95);
    border-color: rgba(13,110,253,0.8);
}

.btn-primary:hover {
    background-color: rgba(13,110,253,1);
    border-color: rgba(13,110,253,1);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13,110,253,0.2);
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: rgba(13,110,253,0.7);
    background-color: rgba(255,255,255,0.95);
}

.btn-outline-primary:hover {
    background-color: rgba(13,110,253,0.95);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13,110,253,0.2);
}

/* Special styling for audio player containers */
.audio-player-container {
    background-color: rgba(248,249,250,0.8);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.1);
}

audio {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.pet-hero.white-bg {
    color: #333 !important;
    text-shadow: none;
}

.pet-hero.white-bg .pet-portrait {
    border: 4px solid #dee2e6;
}

.pet-hero.white-bg .badge {
    color: white;
}

.pet-portrait {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover; /* Fit image within circle dimensions */
    object-position: center; /* Center the image */
    border: 4px solid white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto;
}

.pet-portrait-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.pet-name {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.pet-breed {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.pet-dates .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.pet-bio {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* Memorial Styles */
.memorial-hero {
    background: var(--memorial-bg);
    filter: grayscale(20%);
}

.memorial-portrait {
    filter: sepia(20%) saturate(80%);
}

.memorial-page {
    background: var(--memorial-bg);
    min-height: 100vh;
    color: white;
}

.memorial-frame {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.memorial-candle {
    animation: flicker 2s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.9; transform: scale(1); }
}

.memorial-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

/* Timeline */
.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 1rem;
    width: 11px;
    height: 11px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
}

/* Removed duplicate - consolidated below */

/* Pricing Cards */
.pricing-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.price-display {
    font-size: 1.2rem;
}

.price-display .h2 {
    color: inherit;
}

/* Condolences */
.condolence-messages .card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.condolence-messages .card:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #7C3AED;
    border-color: #7C3AED;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #DB2777;
    border-color: #DB2777;
}

/* Empty States */
.empty-state {
    padding: 3rem 1rem;
}

.empty-state i {
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pet-name {
        font-size: 2rem;
    }
    
    .pet-portrait,
    .pet-portrait-placeholder {
        width: 150px;
        height: 150px;
    }
    
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .timeline-item {
        padding-left: 1.5rem;
    }
    
    .memorial-frame {
        padding: 1rem;
        margin: 1rem 0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .form-control,
    .owner-actions {
        display: none !important;
    }
    
    .pet-hero {
        background: #f8f9fa !important;
        color: #333 !important;
    }
    
    .memorial-page {
        background: white !important;
        color: #333 !important;
    }
    
    .memorial-frame {
        background: white !important;
        border: 1px solid #ccc !important;
    }
}

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

/* Focus states for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pet-card,
    .feature-card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* 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;
    }
    
    .memorial-candle {
        animation: none;
    }
}

/* Timeline Archive and Delete Styles */
.timeline-item-archived {
    opacity: 0.8;
}

.timeline-item-archived .card {
    background-color: #fffbeb;
}

.timeline-item-archived .timeline-media {
    filter: sepia(10%) saturate(90%);
}
