.tc-before-after-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    cursor: col-resize;
    /* Default cursor for whole container */
    background-color: #f0f0f0;
}

/* Images */
.tc-ba-img-after,
.tc-ba-img-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Overridden inline for before */
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.tc-ba-img-after {
    z-index: 1;
}

.tc-ba-img-before {
    z-index: 2;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    /* Optional subtle crisp line */
}

.tc-ba-img-after img,
.tc-ba-img-before img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    max-width: none;
    /* Prevent standard WP theme max-width: 100% constraints */
}

/* Inner Wrapper for Before Image to maintain aspect/size */
.tc-ba-img-inner {
    width: 100%;
    height: 100%;
    display: block;
    /* JS will likely need to force width to match container to stop squishing */
}

/* Handle */
.tc-ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    /* Interaction area width */
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass to container, or use JS on container */
}

.tc-ba-handle-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.tc-ba-handle-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.tc-ba-handle-circle i {
    font-size: 14px;
    margin: 0 2px;
}

/* Labels */
.tc-ba-label {
    position: absolute;
    z-index: 20;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tc-before-after-container:hover .tc-ba-label {
    opacity: 1;
}

.tc-ba-label-before {
    left: 20px;
}

.tc-ba-label-after {
    right: 20px;
}

/* Style Variations */

/* Style 2: Inset Handle (Square) */
.tc-ba-style-2 .tc-ba-handle-circle {
    border-radius: 4px;
    width: 30px;
    height: 30px;
}

/* Style 3: Overlay Labels (Always Visible) */
.tc-ba-style-3 .tc-ba-label {
    opacity: 1;
    top: 20px;
    transform: none;
}

/* Style 4: Minimal (Thin Line, No Circle) */
.tc-ba-style-4 .tc-ba-handle-circle {
    display: none;
}

.tc-ba-style-4 .tc-ba-handle-line {
    width: 4px;
}

/* Style 5: Soft Transition (No change in CSS, maybe logic?) */
/* Just default styling for now */

/* Vertical Orientation */
.tc-ba-vertical {
    cursor: row-resize;
}

.tc-ba-vertical .tc-ba-img-before {
    width: 100% !important;
    /* Force width */
    height: 50%;
    /* JS will control height */
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.tc-ba-vertical .tc-ba-handle {
    width: 100%;
    height: 40px;
    top: 50%;
    left: 0 !important;
    /* Reset left */
    transform: translateY(-50%);
    flex-direction: row;
}

.tc-ba-vertical .tc-ba-handle-line {
    width: 100%;
    height: 2px;
}

.tc-ba-vertical .tc-ba-handle-circle i {
    transform: rotate(90deg);
}

.tc-ba-vertical .tc-ba-label-before {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.tc-ba-vertical .tc-ba-label-after {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}