/* Contest & Promo Gallery Widget - Based on Before/After Gallery CSS structure */

/* Main Widget Container */
.nx-contest-promo-gallery-widget {
    margin: 0px auto;
    display: grid;
    grid-gap: 0px;
    width: 1234px;
    max-width: 1280px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-contest-promo-gallery-widget {
        width: calc(100vw - 16px);
        max-width: 768px;
    }
}

@media (max-width: 767px) {
    .nx-contest-promo-gallery-widget {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}

/* Section Wrapper */
.nx-cp-section-wrapper {
    display: grid;
    grid-gap: 0px;
}

/* Background Container */
.nx-cp-background-container {
    position: relative;
    width: 1234px;
    margin: 0 auto;
    max-width: 1280px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-background-container {
        width: calc(100vw - 16px);
        top: 0;
        transform: translateX(-50%);
        left: 50%;
        max-width: 768px;
    }
}

@media (max-width: 767px) {
    .nx-cp-background-container {
        width: 100%;
        transform: none;
        left: 0;
        top: 14px;
        max-width: 100%;
        position: relative;
    }
}

/* Layered Cards Effect */
.nx-cp-card {
    position: absolute;
    width: 1205px;
    top: 0;
    bottom: 0;
    border-radius: 8px;
}

.nx-cp-bottom-card {
    top: 12px;
    left: 10px;
    transform: rotate(-1deg);
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-bottom-card {
        left: 2px;
        width: 98%;
    }
}

@media (max-width: 767px) {
    .nx-cp-bottom-card {
        left: 2px;
        width: calc(100% - 8px);
        transform: rotate(-1.5deg);
    }
}

.nx-cp-top-card {
    top: 12px;
    left: 16px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-top-card {
        left: 4px;
        width: 99%;
    }
}

@media (max-width: 767px) {
    .nx-cp-top-card {
        left: 4px;
        width: calc(100% - 10px);
    }
}

.nx-cp-yellow-bg {
    background-color: #F5F5F5;
}

.nx-cp-blue-bg {
    background: #FFFFFF;
}

.nx-cp-content-wrapper {
    position: relative;
    z-index: 1;
}

.nx-cp-inner-container {
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-inner-container {
        max-width: 720px;
    }
}

@media (max-width: 767px) {
    .nx-cp-inner-container {
        max-width: 100%;
        width: 100%;
    }
}

.nx-cp-content-padding {
    padding: 72px 0px 72px 0px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-content-padding {
        padding: 40px 24px 0px;
    }
}

@media (max-width: 767px) {
    .nx-cp-content-padding {
        padding: 24px 16px 24px 16px;
    }
}

/* Content Grid - Modified for Gallery Layout */
.nx-cp-content-grid {
    display: grid;
    grid-gap: 48px;
    padding: 0px;
}

@media (min-width: 1280px) {
    .nx-cp-content-grid {
        grid-template-rows: none;
        grid-template-columns: 476px auto;
        justify-content: space-between;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-content-grid {
        grid-template-rows: auto auto;
        grid-template-columns: none;
        justify-content: flex-start;
        grid-gap: 32px;
        padding: 40px 24px 40px;
    }
}

@media (max-width: 767px) {
    .nx-cp-content-grid {
        grid-template-rows: auto auto;
        grid-template-columns: none;
        justify-content: flex-start;
        grid-gap: 32px;
        padding: 48px 24px 48px 24px;
    }
}

/* Text Section */
.nx-cp-text-section {
    display: grid;
    grid-gap: 48px;
    align-content: flex-start;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-text-section {
        grid-gap: 32px;
        max-width: 556px;
    }
}

@media (max-width: 767px) {
    .nx-cp-text-section {
        grid-gap: 32px;
    }
}

.nx-cp-content-stack {
    display: grid;
    grid-gap: 40px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-content-stack {
        grid-gap: 32px;
    }
}

@media (max-width: 767px) {
    .nx-cp-content-stack {
        grid-gap: 24px;
    }
}

.nx-cp-header-group {
    display: grid;
    grid-gap: 16px;
}

@media (max-width: 767px) {
    .nx-cp-header-group {
        grid-gap: 8px;
    }
}

/* Toolbar Badge */
.nx-cp-toolbar-badge {
    display: flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    color: #FFF;
    background-color: #4a90e2;
    border-radius: 4px;
}

.nx-cp-toolbar-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    line-height: 24px;
    font-weight: 700;
    display: block;
}

/* Main Title */
.nx-cp-main-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 48px;
    line-height: 48px;
    font-weight: 400;
    color: #333333;
    margin: 0;
    display: block;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-main-title {
        font-size: 40px;
        line-height: 40px;
    }
}

@media (max-width: 767px) {
    .nx-cp-main-title {
        font-size: 32px;
        line-height: 34px;
    }
}

/* Description */
.nx-cp-description {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    line-height: 24px;
    font-weight: 400;
    color: #666666;
    margin: 0;
    display: block;
}

/* Actions Group */
.nx-cp-actions-group {
    display: grid;
    grid-gap: 16px;
    justify-content: flex-start;
}

@media (max-width: 767px) {
    .nx-cp-actions-group {
        justify-content: initial;
    }
}

.nx-cp-button-row {
    display: grid;
    grid-gap: 16px;
    grid-auto-flow: row;
    align-items: flex-start;
}

/* Download Button */
.nx-cp-download-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
    text-decoration: none;
    width: fit-content;
    height: fit-content;
    justify-content: center;
}

.nx-cp-download-btn:focus {
    outline: 3px solid rgba(74, 144, 226, 0.3);
}

.nx-cp-download-btn:hover {
    background: #357abd;
    color: white;
    text-decoration: none;
}

.nx-cp-download-btn:active {
    background: #2a5a8a;
}

.nx-cp-download-btn::after {
    content: '→';
    transition: transform 0.3s ease;
}

.nx-cp-download-btn:hover::after {
    transform: translateX(3px);
}

@media (max-width: 767px) {
    .nx-cp-download-btn {
        width: 100%;
    }
}

.nx-cp-btn-content {
    display: flex;
    align-items: center;
    width: auto;
    justify-content: center;
    gap: 8px;
}

.nx-cp-btn-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    line-height: 24px;
    font-weight: 700;
    display: block;
    text-align: left;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .nx-cp-btn-text {
        white-space: normal;
    }
}

/* Additional Info */
.nx-cp-additional-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nx-cp-note-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    line-height: 22px;
    font-weight: 400;
    color: rgba(51, 51, 51, 0.7);
    margin: 0;
}

/* Learn More Link */
.nx-cp-learn-more {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    line-height: 22px;
    font-weight: 400;
    display: inline;
}

.nx-cp-learn-link {
    cursor: pointer;
    color: #4a90e2;
    text-decoration: none;
}

.nx-cp-learn-link:hover {
    color: #FF8D00;
    text-decoration: none;
}

/* Gallery Section - Instead of Image Section */
.nx-cp-image-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nx-cp-responsive-image {
    display: block;
    object-fit: contain;
    width: 556px;
    height: 324px;
    aspect-ratio: 556 / 324;
    border-radius: 8px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .nx-cp-gallery-container {
        width: 556px;
        height: 324px;
    }
}

@media (max-width: 767px) {
    .nx-cp-gallery-container {
        width: 100%;
        height: 200px;
    }
    
    .nx-cp-responsive-image {
        width: 100%;
        height: 200px;
        max-height: 200px;
    }
}

/* Gallery Items */
.nx-cp-gallery-items {
    position: relative;
    width: 556px;
    height: 324px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .nx-cp-gallery-items {
        width: 100%;
        height: 200px;
    }
}

.nx-cp-gallery-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.nx-cp-gallery-item.active {
    display: block;
}

/* Single Promo Image Container */
.nx-cp-single-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.nx-cp-promo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* Gallery Navigation */
.nx-cp-gallery-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    width: fit-content;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nx-cp-nav-arrow {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid lightgray;
    border-radius: 10%;
    color: gray;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.25);
}

.nx-cp-nav-arrow:hover {
    background: #4a90e2;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.4);
}

.nx-cp-nav-arrow:active {
    transform: scale(0.95);
}

.nx-cp-nav-arrow:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: rgba(128, 128, 128, 0.5);
    border-color: rgba(211, 211, 211, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.1);
}

/* Gallery Dots */
.nx-cp-gallery-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nx-cp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(128, 128, 128, 0.3);
}

.nx-cp-dot.active {
    background: #4a90e2;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.5);
}

/* Gallery Counter */
.nx-cp-gallery-counter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    color: rgba(128, 128, 128, 0.8);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(128, 128, 128, 0.2);
}

/* Placeholder for empty gallery */
.nx-cp-placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 556px;
    height: 324px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

@media (max-width: 767px) {
    .nx-cp-placeholder-image {
        width: 100%;
        height: 200px;
    }
}

.nx-cp-placeholder-text {
    color: rgba(128, 128, 128, 0.7);
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

/* Seasonal Color Variations */
.nx-contest-promo-gallery-widget.spring .nx-cp-yellow-bg {
    background-color: #F5F5F5;
}

.nx-contest-promo-gallery-widget.spring .nx-cp-toolbar-badge {
    background-color: #4a90e2;
}

.nx-contest-promo-gallery-widget.spring .nx-cp-download-btn {
    background: #4a90e2;
}

.nx-contest-promo-gallery-widget.spring .nx-cp-download-btn:hover {
    background: #357abd;
}

.nx-contest-promo-gallery-widget.summer .nx-cp-yellow-bg {
    background-color: #F5F5F5;
}

.nx-contest-promo-gallery-widget.summer .nx-cp-toolbar-badge {
    background-color: #4a90e2;
    color: #FFF;
}

.nx-contest-promo-gallery-widget.summer .nx-cp-download-btn {
    background: #4a90e2;
    color: #FFF;
}

.nx-contest-promo-gallery-widget.summer .nx-cp-download-btn:hover {
    background: #357abd;
}

.nx-contest-promo-gallery-widget.fall .nx-cp-yellow-bg {
    background-color: #F5F5F5;
}

.nx-contest-promo-gallery-widget.fall .nx-cp-toolbar-badge {
    background-color: #4a90e2;
}

.nx-contest-promo-gallery-widget.fall .nx-cp-download-btn {
    background: #4a90e2;
}

.nx-contest-promo-gallery-widget.fall .nx-cp-download-btn:hover {
    background: #357abd;
}

.nx-contest-promo-gallery-widget.winter .nx-cp-yellow-bg {
    background-color: #F5F5F5;
}

.nx-contest-promo-gallery-widget.winter .nx-cp-toolbar-badge {
    background-color: #4a90e2;
}

.nx-contest-promo-gallery-widget.winter .nx-cp-download-btn {
    background: #4a90e2;
}

.nx-contest-promo-gallery-widget.winter .nx-cp-download-btn:hover {
    background: #357abd;
}