/**
 * Advance Tab Styles
 *
 * Styles for the Advance tab in popup editor
 * Loaded on: Popup editor pages (Advance tab)
 */

/* Actions & Events Section - Modern 2-Column Layout */
.ipb-actions-events {
    text-align: left;
}

.ipb-actions-events .ipb_background_wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.ipb-actions-events .background_field {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    align-items: flex-start;
    text-align: left;
    justify-content: flex-start;
}

.ipb-actions-events .ipb-actions-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    min-height: 0;
    position: relative;
    width: 100%;
    text-align: left;
}

.ipb-actions-events .ipb-actions-row:last-child {
    margin-bottom: 0;
}

/* Ensure rows don't overlap */
.ipb-actions-events .ipb-actions-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ipb-actions-events .ipb-actions-redirect-section,
.ipb-actions-events .ipb-actions-popup-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ipb-actions-events .ipb-actions-label {
    align-self: center;
    text-align: left;
}

.ipb-actions-events .ipb-actions-label label {
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
    text-align: left;
}

.ipb-actions-events .ipb-actions-control {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    align-self: center;
    text-align: left;
}

/* When control contains helper text, align to start for proper stacking */
.ipb-actions-events .ipb-actions-control .ipb-actions-helper {
    margin-top: 8px;
}

.ipb-actions-events .ipb-actions-control .regular-text {
    width: 100%;
    max-width: 100%;
}

.ipb-actions-events .ipb-actions-helper {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #646970;
    line-height: 1.4;
}

/* Toggle Switch Styles */
.ipb-actions-events .ipb-actions-control .input.toggle.switch {
    margin: 0;
    align-self: flex-start;
}

/* Toggle Switch Styles - Use Original WordPress-native Styles */
/* The toggle inherits from design-tab.css .input.toggle.switch styles */
.ipb-actions-events .input.toggle.switch {
    flex: 0 0 auto;
    width: 38px !important;
    height: 22px;
    padding: 1px 5px !important;
}

/* Input Styles */
.ipb-actions-events input[type="url"],
.ipb-actions-events input[type="text"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #8c8f94;
    border-radius: 2px;
    font-size: 14px;
    color: #2c3338;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out;
}

.ipb-actions-events input[type="url"]:focus,
.ipb-actions-events input[type="text"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.ipb-actions-events select.regular-text {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #8c8f94;
    border-radius: 2px;
    font-size: 14px;
    color: #2c3338;
    background-color: #fff;
}

.ipb-actions-events select.regular-text:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Checkbox Styles */
.ipb-actions-events input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.ipb-actions-events label {
    cursor: pointer;
}

/* Collapsed Content */
.ipb-actions-events .ipb-actions-content {
    margin-top: 0;
    clear: both;
}

/* Ensure proper spacing between sections */
.ipb-actions-events .ipb-actions-redirect-section .ipb-actions-row,
.ipb-actions-events .ipb-actions-popup-section .ipb-actions-row {
    margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 782px) {
    .ipb-actions-events .ipb-actions-row {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 16px;
        align-items: flex-start;
        text-align: left;
    }
    
    .ipb-actions-events .ipb-actions-label {
        align-self: flex-start;
        text-align: left;
    }
    
    .ipb-actions-events .ipb-actions-control {
        align-self: flex-start;
        text-align: left;
    }
}

/* Legacy support - keep old selectors for backward compatibility */
div#action_wrapper {
    width: 100%;
}

div#action_redirect {
    padding: 0;
    width: 100%;
}

#action_wrapper .action_new_tab {
    display: flex;
    align-items: center;
    gap: 4px;
}

.play {
    display: flex;
    gap: 30px;
}

.label.media_upload {
    display: flex;
    text-align: center;
    padding: 20px 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.label.media_upload i {
    background: #1a73e8;
    font-size: 40px;
}

.sound_fields i,
.media_upload i {
    cursor: pointer;
    width: fit-content;
    color: white;
    background: #1a73e8;
    padding: 10px;
}

.sound_input h3 {
    width: 100%;
}

/* End Advance tab */
