/* Ad Modal Viewer Styles */

/* Modal overlay and container */
#ad-modal-overlay {
    backdrop-filter: blur(2px);
}

#ad-modal {
    animation: modalFadeIn 0.3s ease-out;
}

#ad-modal.closing {
    animation: modalFadeOut 0.3s ease-in;
}

/* Modal content animations */
#ad-modal > div {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Media gallery styles */
#media-gallery-container {
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 400px;
}

#media-gallery-container img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease-in-out;
}

#media-gallery-container video {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Navigation controls */
#navigation-controls button {
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(4px);
}

#navigation-controls button:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.8);
}

#navigation-controls button:active {
    transform: scale(0.95);
}

/* Media counter */
#media-counter {
    backdrop-filter: blur(4px);
    font-weight: 500;
}

/* Contact buttons */
#contact-actions button {
    transition: all 0.2s ease-in-out;
    font-weight: 600;
}

#contact-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#contact-actions button:active {
    transform: translateY(0);
}

/* Phone button specific styles */
#phone-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#phone-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* WhatsApp button specific styles */
#whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

#whatsapp-btn:hover {
    background: linear-gradient(135deg, #22c55e 0%, #0f766e 100%);
}

/* Favorite button styles */
#favorite-btn {
    transition: all 0.2s ease-in-out;
}

#favorite-btn.favorited {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
}

#favorite-btn.favorited:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Reputation stats */
#reputation-stats {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
}

/* Verification badge */
#verification-badge span {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Loading states */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.error-state {
    color: #ef4444;
    text-align: center;
    padding: 2rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #ad-modal {
        padding: 1rem;
    }
    
    #ad-modal > div {
        max-height: 95vh;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    #ad-modal {
        padding: 0;
    }
    
    #ad-modal > div {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    #media-gallery-container {
        aspect-ratio: 4/3;
        min-height: 300px;
    }
    
    #navigation-controls button {
        padding: 0.75rem;
    }
    
    #navigation-controls button svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Touch-friendly contact buttons */
    #contact-actions button {
        padding: 1rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    #media-gallery-container {
        min-height: 250px;
    }
    
    .lg\\:w-1\\/3 {
        padding: 1rem;
    }
    
    #ad-title {
        font-size: 1.5rem;
    }
}

/* Animation keyframes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Media transition effects */
.media-transition-enter {
    opacity: 0;
    transform: translateX(20px);
}

.media-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.media-transition-exit {
    opacity: 1;
    transform: translateX(0);
}

.media-transition-exit-active {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Swipe gesture indicators */
.swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.swipe-indicator.left {
    left: 1rem;
}

.swipe-indicator.right {
    right: 1rem;
}

.swipe-indicator.active {
    opacity: 1;
}

/* Focus states for accessibility */
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #ad-modal-overlay {
        background-color: rgba(0, 0, 0, 0.9);
    }
    
    #navigation-controls button,
    #modal-close-btn {
        background-color: rgba(0, 0, 0, 0.9);
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}