.partners-header {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.bonus-resources-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.dx-container {
    flex: 1;
    min-width: 300px; /* Reverted min-width for dx container */
    max-width: 500px; /* Reverted max-width for dx container */
    background-color: var(--color-card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: calc(var(--spacing-unit) * 2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
    min-height: 900px; /* Increased min-height for the dx container */
    justify-content: space-between; /* Distribute content vertically */
}

.slideshow-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    background-color: var(--color-card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: calc(var(--spacing-unit) * 2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
    min-height: 700px; /* Hard fix: Set a consistent minimum height for the entire card */
    justify-content: space-between; /* Distribute content vertically */
}

.slideshow-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    gap: var(--spacing-unit);
}

.slideshow-branding img {
    height: 40px;
    width: auto;
}

.slideshow-branding h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--color-primary);
}

.maths-branding h2 {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1; /* Allow wrapper to take available space */
    overflow: hidden;
    margin-bottom: var(--spacing-unit);
    display: flex; /* Ensure flex context for absolute children */
    align-items: center;
    justify-content: center;
}

.slides {
    position: absolute; /* Position slides absolutely to stack them */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Fill the wrapper height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Distribute content vertically */
    padding: var(--spacing-unit);
    opacity: 0;
    z-index: 1; /* Ensure slides are layered */
    transition: opacity 0.8s ease-in-out; /* Only transition opacity */
}

.slides.active {
    opacity: 1;
    z-index: 2; /* Bring active slide to front */
}

.slide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1; /* Allow content to grow */
    justify-content: space-between; /* Distribute content within slide-content */
    width: 100%;
}

.slide-content h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-unit);
    font-size: 1.4rem;
    color: var(--color-text-dark);
}

.slide-image {
    max-width: 100%;
    height: auto; /* Allow image to take natural height */
    max-height: 200px; /* Max height for all single images */
    object-fit: contain;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-unit);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* Prevent image from shrinking */
}

.comparison-images {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: var(--spacing-unit);
    height: auto; /* Allow comparison image container to take natural height */
    max-height: 200px; /* Max height for comparison image container */
    flex-shrink: 0; /* Prevent container from shrinking */
}

.comparison-images img {
    max-width: 48%;
    height: auto; /* Allow images to take natural height */
    max-height: 180px; /* Max height for comparison images */
    object-fit: contain;
}

.slide-content p {
    color: var(--color-text-medium);
    font-size: 0.95rem;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    flex-grow: 1; /* Allow description to grow */
    display: flex;
    align-items: flex-start; /* Align text to the top within its flex container */
    justify-content: center;
    min-height: 60px; /* Ensure a minimum height for description to prevent collapse */
    overflow: auto; /* Allow text to scroll if it overflows */
}

.slide-link {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 0.8) calc(var(--spacing-unit) * 1.5);
    background-color: var(--color-primary);
    color: var(--color-card-background);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    margin-top: auto; /* Push button to the bottom */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.slide-link:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
}

.dx-slide-link {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    color: var(--color-card-background); /* Ensure text is visible */
}

.dx-slide-link:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%); /* Adjust hover for dx link */
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.slide-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slide-prev {
    left: 10px;
}

.slide-next {
    right: 10px;
}

.dots-container {
    text-align: center;
    margin-top: var(--spacing-unit);
    flex-shrink: 0; /* Prevent dots from shrinking */
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: var(--color-border);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active,
.dot:hover {
    background-color: var(--color-primary);
}

.phone-frame {
    width: 200px;
    height: 400px;
    border: 10px solid #333;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    margin: var(--spacing-unit) auto;
    box-shadow: 0 0 0 2px #ccc, 0 0 0 12px #eee, 0 20px 40px rgba(0, 0, 0, 0.4);
    flex-shrink: 0; /* Prevent phone frame from shrinking */
}

.phone-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.disclaimer-footer {
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 4);
    padding: var(--spacing-unit);
    font-size: 0.85rem;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.disclaimer-footer .link-subtle {
    font-size: 0.85rem;
}

/* Dark mode adjustments */
html[data-theme='dark'] .dx-container,
html[data-theme='dark'] .slideshow-container {
    background-color: var(--color-card-background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

html[data-theme='dark'] .slideshow-branding h2 {
    color: var(--color-text-dark);
}

html[data-theme='dark'] .maths-branding h2 {
    -webkit-text-fill-color: var(--color-text-dark);
}

html[data-theme='dark'] .slide-content h3 {
    color: var(--color-text-dark);
}

html[data-theme='dark'] .slide-content p {
    color: var(--color-text-medium);
}

html[data-theme='dark'] .slide-link {
    background-color: var(--color-primary);
    color: var(--color-text-dark);
}

html[data-theme='dark'] .slide-link:hover {
    background-color: var(--color-primary-hover);
}

html[data-theme='dark'] .dot {
    background-color: var(--color-border);
}

html[data-theme='dark'] .dot.active,
html[data-theme='dark'] .dot:hover {
    background-color: var(--color-primary);
}

html[data-theme='dark'] .phone-frame {
    border: 10px solid #555;
    box-shadow: 0 0 0 2px #555, 0 0 0 12px #333, 0 20px 40px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
    .bonus-resources-layout {
        flex-direction: column;
        align-items: center;
    }

    .dx-container,
    .slideshow-container {
        max-width: 100%;
    }

    .slide-nav {
        padding: 0.3rem 0.7rem;
        font-size: 1.2rem;
    }

    .phone-frame {
        width: 180px;
        height: 360px;
    }
}
