/* OfferUI Component Styles */

/* Product Card Styles */
.offer-card {
    transition: all 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    /* Fixed height for virtualization consistency */
    height: 450px;
    min-height: 450px;
    max-height: 450px;
    /* Use flexbox to control layout */
    display: flex;
    flex-direction: column;
}

.offer-card:hover:not(:focus) {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    border-color: #2999F1;
}

.offer-card:focus {
    outline: 2px solid #2999F1;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(41, 153, 241, 0.2);
}

.offer-card:focus:hover {
    outline: 2px solid #2999F1;
    outline-offset: 2px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18), 0 0 0 4px rgba(41, 153, 241, 0.2);
}

/* ImageViewer Styles for Product Cards */
.offer-card-image-container {
    width: 100%;
    height: 200px;
    background: #fafafa;
    padding: 15px;
    transition: transform 0.3s ease;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0; /* Don't shrink the image area */
}

.offer-card-image {
    width: 100% !important;
    height: 170px !important;
    object-fit: contain !important;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.offer-card-image:hover {
    transform: scale(1.05);
}

.offer-card:hover .offer-card-image-container {
    transform: scale(1.02);
}

/* Legacy img support - can be removed once all images use ImageViewer */
.offer-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 15px;
    background: #fafafa;
    transition: transform 0.3s ease;
}

.offer-card:hover .card-img-top {
    transform: scale(1.05);
}

.offer-card .card-body {
    padding: 15px;
    /* Take up available space between image and footer */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0; /* Allow content to shrink if needed */
}

/* Ensure card footer centers the button properly */
.offer-card .card-footer {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Don't shrink the footer */
    height: 70px; /* Fixed footer height for consistent button positioning */
}

/* Minimal Buy Button */
.offer-buy-btn {
    background: #2999F1;
    border: 1px solid #2999F1;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.offer-buy-btn:hover {
    background: #1e7bb8;
    border-color: #1e7bb8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(41, 153, 241, 0.4);
}

.offer-buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(41, 153, 241, 0.3);
}

.offer-buy-btn:focus {
    outline: 2px solid #2999F1;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(41, 153, 241, 0.2);
}

.offer-buy-btn-icon {
    font-size: 12px;
}

/* Product Details */
.offer-discount {
    color: #2999F1;
    font-weight: bold;
    font-size: 16px;
}

.offer-price {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.offer-original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 14px;
}

.offer-product-name {
    font-size: 14px;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Text Signup Card Styles */
.text-signup-card {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    /* Auto height on desktop/tablet */
    height: auto;
}

/* Mobile - fixed height to match ProductCards */
@media (max-width: 575px) {
    .text-signup-card {
        height: 450px;
        min-height: 450px;
        max-height: 450px;
    }
}

.text-signup-card:hover:not(:focus-within) {
    transform: translateY(-6px);
    border-color: #2999F1;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.text-signup-link {
    display: block;
    text-decoration: none;
    width: 100%;
}

.text-signup-card:focus-within {
    border: 2px solid #2999F1;
    box-shadow: 0 0 0 4px rgba(41, 153, 241, 0.1);
}

.text-signup-link:focus {
    outline: none;
}

.text-signup-image {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* Mobile - smaller image that doesn't stretch */
@media (max-width: 575px) {
    .text-signup-image {
        width: auto;
        max-width: 60%;
        height: auto;
        max-height: 430px; /* Prevent overflow from 450px card */
        margin: 10px auto;
        display: block;
        object-fit: contain;
    }
}


/* OfferBug Brand Styles */

/* Logo and Images */
img.logo {
    width: 100%;
    max-width: 480px;
}

img.signup-image {
    width: 100%;
    max-width: 300px;
}

/* Brand Colors and Layout */
.bg-whitesmoke {
    background-color: #f3f3f3;
    transition: background-color 0.3s ease;
}

.celestial-blue {
    color: #2999F1;
}

.footer-bg {
    background-color: #3b3b3b;
    padding: 40px 0 20px 0;
    transition: background-color 0.3s ease;
}

.header-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Banner styles */
.offerbug-banner {
    background-color: #e6e6e6 !important;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 20px;
    text-align: center;
    font-size: 16px;
    color: #0e3651;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Header logo section styles */
.header-bg {
    background-color: #2999F1 !important;
    width: 100%;
    padding: 15px 0;
}

/* Theme Toggle Button */
.theme-toggle-container {
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 10;
}

.theme-toggle-btn {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
    transform: scale(1.05);
}

.theme-toggle-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}


@media (max-width: 768px) {
    .theme-toggle-container {
        padding: 0 10px;
    }
    
    .theme-toggle-btn {
        width: 35px !important;
        height: 35px !important;
    }
}

/* Typography */
h2, h3, h4 {
    margin: 15px 0;
}

/* Subscription Form Styles */
.subscribe-button {
    background-color: #F64540 !important;
    border: 1px solid #F64540 !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.subscribe-button:hover {
    background-color: #d63831 !important;
    border-color: #d63831 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(246, 69, 64, 0.3);
}

.subscribe-button:focus {
    outline: 2px solid #F64540;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(246, 69, 64, 0.2);
}

.subscribe-button:active {
}

/* Media Queries */
@media (max-width: 626px) {
    .offerbug-banner {
        font-size: 12px;
        padding: 8px 15px;
    }
}

/* Footer Mobile Spacing */
@media (max-width: 768px) {
    .footer-bg .row.text-center {
        padding-top: 15px;
        margin-top: 20px;
        border-top: 1px solid #555;
    }
}

/* Privacy Page Styles */
.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
}

.privacy-content h2 {
    color: #0e3651;
    border-bottom: 2px solid #2999F1;
    padding-bottom: 10px;
    margin-bottom: 30px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.privacy-content h3 {
    color: #495057;
    margin-top: 30px;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.privacy-content h4 {
    color: #6c757d;
    margin-top: 25px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.privacy-content p {
    margin-bottom: 15px;
    text-align: justify;
    transition: color 0.3s ease;
}

.privacy-content ul {
    margin-bottom: 15px;
    padding-left: 30px;
}

.privacy-content ul li {
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.privacy-content strong {
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Footer Privacy Link Styling */
.footer-bg a {
    text-decoration: underline !important;
    transition: color 0.3s ease;
}

.footer-bg a:hover {
    text-decoration: underline !important;
}

/* Dialog Image Container Styles */
.dialog-image-container {
    width: 100%;
    background: #fafafa !important;
    background-color: #fafafa !important;
    padding: 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

/* Dialog Product Title Styles */
.dialog-product-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #333;
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    word-wrap: break-word !important;
    text-overflow: clip !important;
    max-width: none !important;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    transition: color 0.3s ease;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    text-align: left !important;
}

/* Smooth transitions for virtualization */
.offer-card {
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform;
}

/* Skeleton loading improvements */
.skeleton-avatar, .skeleton-paragraph {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

/* Force skeleton components to respect custom dimensions */
.offer-card .skeleton {
    flex-shrink: 0 !important;
}

.offer-card .skeleton .skeleton-content {
    width: 100% !important;
    height: 100% !important;
    min-width: unset !important;
    min-height: unset !important;
}

.offer-card .skeleton .skeleton-avatar {
    width: 100% !important;
    height: 100% !important;
    min-width: unset !important;
    min-height: unset !important;
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ensure consistent dimensions for skeleton cards */
.offer-card .offer-card-image-container {
    background: #fafafa;
    min-height: 200px;
}

/* Prevent layout shifts during virtualization */
.virtualize-container {
    contain: layout style paint;
}

/* Loading trigger styling */
.loading-trigger {
    min-height: 120px;
    margin: 30px 0;
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.loading-trigger.loading-active {
    background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
    border-color: #2999F1;
    box-shadow: 0 4px 20px rgba(41, 153, 241, 0.1);
    transform: scale(1.02);
}

.loading-trigger .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-dots {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #2999F1;
}

.loading-dots .dot-1,
.loading-dots .dot-2,
.loading-dots .dot-3 {
    animation: loading-dots 1.5s infinite;
    font-size: 20px;
    color: #2999F1;
    margin-left: 2px;
}

.loading-dots .dot-1 {
    animation-delay: 0s;
}

.loading-dots .dot-2 {
    animation-delay: 0.3s;
}

.loading-dots .dot-3 {
    animation-delay: 0.6s;
}

@keyframes loading-dots {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.scroll-indicator {
    animation: bounce-down 2s infinite;
    color: #adb5bd;
    font-size: 18px;
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(8px);
    }
    60% {
        transform: translateY(4px);
    }
}

.loading-trigger p {
    color: #2999F1;
    font-size: 16px;
    margin-top: 10px;
    animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.loading-trigger small {
    color: #6c757d;
    font-size: 13px;
    transition: color 0.3s ease;
}

.loading-trigger:hover small {
    color: #495057;
}

/* Subtle shimmer effect when loading */
.loading-trigger.loading-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Dialog loading animations */
.fa-stop-circle {
    animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Simple loading popup - default light mode styles */
.loading-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 320px;
    min-width: 250px;
    backdrop-filter: blur(8px);
    animation: popup-appear 0.3s ease-out;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    color: #333;
}

.loading-popup.cancelled {
    border-color: #ffc107;
    background: rgba(255, 248, 220, 0.98);
    color: #333;
}

.loading-popup .text-muted {
    color: #6c757d;
}

.loading-popup .text-warning {
    color: #ffc107;
}

/* Removed automatic dark mode support based on system preference - 
   we want to only use our explicit theme toggle via [data-bs-theme="dark"] */

/* Dark mode overrides */
[data-bs-theme="dark"] .loading-popup {
    background: rgba(33, 37, 41, 0.95);
    border-color: #495057;
    color: #e9ecef;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(41, 153, 241, 0.1);
    backdrop-filter: blur(12px);
}

[data-bs-theme="dark"] .loading-popup.cancelled {
    background: rgba(102, 77, 3, 0.95);
    border-color: #ffc107;
    color: #fff;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.2), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .loading-popup .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .loading-popup .text-warning {
    color: #ffc107 !important;
}

/* Enhanced dark mode animations */
[data-bs-theme="dark"] .loading-popup {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* LoadingStatusNotification dark theme is now handled in the component's scoped CSS */

/* Dark mode loading trigger */
[data-bs-theme="dark"] .loading-trigger {
    background: #2d2d2d;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .loading-trigger.loading-active {
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
    border-color: #2999F1;
    box-shadow: 0 4px 20px rgba(41, 153, 241, 0.3);
}

[data-bs-theme="dark"] .loading-trigger small {
    color: #adb5bd;
}

[data-bs-theme="dark"] .loading-trigger:hover small {
    color: #e9ecef;
}

@keyframes popup-appear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 576px) {
    .loading-popup {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    
    @keyframes popup-appear {
        0% {
            opacity: 0;
            transform: translateY(20px) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}


