/* =========================================
   Wrapper Card (Modern Container)
   ========================================= */

.dt-wrapper-card {
    background-color: #ffffff;
    border: 1px solid #eaeaea; /* Subtle border like preview_frame */
    border-radius: 16px;       /* Matching rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); /* Soft, modern shadow */
    margin-bottom: 30px;
    overflow: hidden;          /* Keeps child elements inside corners */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Optional: Hover effect for interactive feel */
.dt-wrapper-card.dt-hoverable:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

/* --- Header Section --- */
.dt-wrapper-header {
    background-color: #f8f9fa; /* Light grey header like preview_frame */
    border-bottom: 1px solid #eaeaea;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dt-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dt-card-icon {
    color: #64748b; /* Slate grey icon */
    font-size: 16px;
}

.dt-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: -0.01em;
}

/* --- Body Section --- */
.dt-wrapper-body {
    padding: 30px; /* Generous whitespace */
    color: #4a5568;
}

/* --- Gravity Forms Integration Fixes --- */
/* If a Gravity Form is inside our wrapper, remove its own shadow/margin
   so it looks like it belongs to the card natively. */
.dt-wrapper-card .gform_wrapper.gravity-theme {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    background: transparent !important;
}

/* Adjust title size if inside wrapper */
.dt-wrapper-card .gform_wrapper.gravity-theme .gform_heading {
    margin-bottom: 20px;
}

/* =========================================
   Pagination / Multi-Step Navigation
   ========================================= */

/* Container for the Next/Prev buttons */
.dt-pagination-nav {
    margin-top: 30px;              /* Space between form fields and buttons */
    padding-top: 20px;             /* Space inside the container */
    border-top: 1px solid #eaeaea; /* Separator line matching card border */
    display: flex;
    justify-content: space-between; /* Pushes buttons to far left/right */
    align-items: center;
}

/* Base Button Style (Used for "Previous") */
.dt-btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;            /* Comfortable click area */
    background-color: #f8f9fa;     /* Light grey background */
    border: 1px solid #e2e8f0;     /* Subtle border */
    border-radius: 8px;            /* Modern rounded corners */
    color: #4a5568;                /* Dark grey text */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.5;
}

/* Hover effect for base button */
.dt-btn-nav:hover {
    background-color: #edf2f7;
    color: #2d3748;
    border-color: #cbd5e0;
    transform: translateY(-1px);   /* Slight lift effect */
}

/* Primary Button Style (Used for "Next") */
.dt-btn-nav.primary {
    background-color: #3182ce;     /* Brand blue matching dashboard */
    border-color: #3182ce;
    color: #ffffff;
}

/* Hover effect for primary button */
.dt-btn-nav.primary:hover {
    background-color: #2b6cb0;     /* Darker blue on hover */
    border-color: #2b6cb0;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.25); /* Soft blue glow */
}

/* Focus states for accessibility */
.dt-btn-nav:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.4); /* Blue focus ring */
}

/* =========================================
   Update Button Integration
   ========================================= */

/* Force the Gravity Forms Submit/Update button to look exactly like the nav buttons */
.dt-pagination-nav input[type="submit"].dt-btn-nav,
.dt-pagination-nav button[type="submit"].dt-btn-nav {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 24px !important;
    background-color: #3182ce !important; /* Brand Blue */
    border: 1px solid #3182ce !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5 !important;
    height: auto !important;
    width: auto !important;
    box-shadow: none !important;
    text-transform: none !important;
    margin: 0 !important;
}

/* Hover state for the moved update button */
.dt-pagination-nav input[type="submit"].dt-btn-nav:hover,
.dt-pagination-nav button[type="submit"].dt-btn-nav:hover {
    background-color: #2b6cb0 !important;
    border-color: #2b6cb0 !important;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.25) !important;
    transform: translateY(-1px);
}

/* Hide the update button if it is somehow still in the footer but handled by JS */
.gform_footer input[type="submit"].hidden-by-pagination {
    display: none !important;
}

/* =========================================
   Custom Loading Bar (Side-Loader)
   ========================================= */

/* Container to keep Loader and Button together on the right side */
.dt-nav-right-group {
    display: flex;
    align-items: center;
    gap: 15px; /* Distance between loader and button */
}

/* The Loading Bar */
.dt-loader-bar {
    width: 100px;       /* Length of the bar */
    height: 4px;        /* Thickness */
    background: #edf2f7; /* Light grey background track */
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    display: none;      /* Hidden by default */
}

/* The moving part */
.dt-loader-bar::after {
    content: '';
    position: absolute;
    left: -50%;
    height: 100%;
    width: 50%;
    background: #3182ce; /* Your Brand Blue */
    border-radius: 2px;
    animation: dt-slide 1s infinite linear;
}

@keyframes dt-slide {
    0% { left: -50%; }
    100% { left: 100%; }
}

/* Optional: Fade out the button slightly when loading */
.dt-btn-nav.dt-loading-active {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}