/* ======================================================
   MODAL & NOTIFICATION COMPONENTS - MODERN & PROFESSIONAL
   ====================================================== */

/* Modal colour palette now supplied by the central theme bridge (theme.css) */

.notification.error .notification-icon {
    background: var(--z-danger-bg);
    color: var(--modal-error);
}

.notification.warning .notification-icon {
    background: var(--z-accent-glow);
    color: var(--modal-warning);
}

.notification.info .notification-icon {
    background: var(--z-accent-glow);
    color: var(--modal-info);
}

.notification-icon i {
    font-size: 18px;
}

/* Notification Content */
.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--modal-primary);
    line-height: 1.3;
}

.notification-content p {
    font-size: 0.875rem;
    color: var(--z-overlay);
    margin: 0;
    line-height: 1.4;
}

/* Notification Close */
.notification-close {
    background: none;
    border: none;
    color: var(--z-glass);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    background: var(--z-surface-1);
    color: var(--z-overlay);
}

/* ======================================================
   BACK TO TOP BUTTON
   ====================================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--modal-accent), var(--modal-accent-light));
    border: none;
    border-radius: 50%;
    color: var(--modal-primary);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 
        0 8px 25px var(--z-accent-glow),
        0 0 40px var(--z-accent-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 
        0 15px 35px var(--z-accent-glow),
        0 0 60px var(--z-accent-glow);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

.back-to-top i {
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* Progress Ring for Back to Top */
.back-to-top::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: conic-gradient(
        var(--modal-accent) var(--scroll-progress, 0%),
        transparent var(--scroll-progress, 0%)
    );
    z-index: -1;
    transition: all 0.3s ease;
}

/* ======================================================
   RESPONSIVE DESIGN
   ====================================================== */
@media (max-width: 1024px) {
    .modal-container {
        width: 95vw;
        max-height: 90vh;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .preview-image-section {
        flex: none;
        height: 300px;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .modal-container {
        border-radius: 16px;
        margin: 10px;
        width: calc(100vw - 20px);
    }
    
    .modal-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .modal-header-actions {
        align-self: flex-end;
        margin-top: -40px;
    }
    
    .modal-body {
        min-height: 400px;
    }
    
    .preview-image-section {
        height: 250px;
    }
    
    .preview-details-section {
        padding: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .footer-left,
    .footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        min-width: 120px;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .seller-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .btn-primary,
    .btn-secondary {
        justify-content: center;
        width: 100%;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .modal-title {
        font-size: 1.25rem;
    }
    
    .current-price {
        font-size: 1.5rem;
    }
    
    .modal-action-btn,
    .modal-close {
        width: 36px;
        height: 36px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.875rem;
        min-width: 100px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
    
    .notification {
        padding: 15px;
        gap: 12px;
    }
    
    .notification-icon {
        width: 36px;
        height: 36px;
    }
    
    .notification-icon i {
        font-size: 16px;
    }
    
    .notification-content h4 {
        font-size: 0.9375rem;
    }
    
    .notification-content p {
        font-size: 0.8125rem;
    }
    
    .back-to-top {
        width: 44px;
        height: 44px;
        font-size: 16px;
        bottom: 15px;
        right: 15px;
    }
}

/* ======================================================
   ACCESSIBILITY & HIGH CONTRAST
   ====================================================== */

@media (prefers-contrast: high) {
    .modal-content,
    .notification,
    .back-to-top {
        border: 2px solid var(--modal-text-primary);
        background: var(--modal-primary);
    }
    
    .modal-close {
        border: 2px solid var(--modal-text-secondary);
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid var(--modal-accent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification,
    .back-to-top,
    .btn-primary,
    .btn-secondary{
        animation: none;
        transition: none;
    }
    
    .back-to-top:hover,
    .modal-close:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .modal-container,
    .btn,
    .modal-action-btn,
    .tag-item {
        transition: none;
        animation: none;
    }
    
    .spinner-ring {
        animation: none;
    }
}
/* Focus Styles for Accessibility */

.btn-primary:focus,
.btn-secondary:focus,
.notification-close:focus,
.back-to-top:focus {
    outline: 2px solid var(--modal-accent);
    outline-offset: 2px;
}
.modal-action-btn:focus,
.modal-close:focus,
.btn:focus {
    outline: 2px solid var(--modal-accent);
    outline-offset: 2px;
}

/* GPU Acceleration */
.modal-container,
.preview-main-image,
.btn,
.modal-action-btn {
    will-change: transform;
    transform: translateZ(0);
}
/* (Legacy preview modal .pmod-* selectors fully removed; modern styles live in modern-preview-modal.css) */

/* ======================================================
   PRINT STYLES
   ====================================================== */

@media print {
    .modal,
    .notification,
    .back-to-top {
        display: none !important;
    }
}

/* ======================================================
   ANIMATIONS
   ====================================================== */

@keyframes notificationSlideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes backToTopPulse {
    0% {
        box-shadow: 0 8px 25px var(--z-accent-glow);
    }
    50% {
        box-shadow: 0 8px 25px var(--z-accent-glow);
    }
    100% {
        box-shadow: 0 8px 25px var(--z-accent-glow);
    }
}

.back-to-top.pulse {
    animation: backToTopPulse 2s infinite;
}

/* Removed duplicate GPU Acceleration + legacy preview modal block */