/* ========================================
   INTRO PHOTO EDITOR - Refined Layout
   Matches video-editor design patterns
   ======================================== */

/* Override container to match video-editor structure */
#intro-editor-modal .intro-editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    /* Wider for PC */
    margin: 0 auto;
    padding: 20px;
    /* Some breathing room on PC */
    position: relative;
    box-sizing: border-box;
    justify-content: center;
}

/* Canvas Area - Centered, contains cropper */
.intro-canvas-wrapper {
    position: relative;
    width: 100%;
    /* No fixed aspect ratio - let it be flexible */
    min-height: 500px;
    /* Taller for PC */
    height: auto;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
}

.intro-cropper-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#intro-cropper-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Preview Overlay Canvas */
#intro-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* ========================================
   TEXT POSITION BLOCK - Minimal Hit Area
   ======================================== */
#text-position-block {
    position: absolute;
    z-index: 20;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#text-position-block:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}

#text-position-block.dragging {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
}

.text-block-hint {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#text-position-block:hover .text-block-hint,
#text-position-block.dragging .text-block-hint {
    opacity: 1;
}

/* ========================================
   GRADIENT CONTROLS - Video Editor Style
   Attached below the image like trim-area
   ======================================== */
.intro-gradient-controls {
    width: 100%;
    padding: 20px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.intro-slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.intro-slider-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 40px;
    text-align: right;
}

.intro-slider-value {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    min-width: 32px;
    text-align: center;
}

/* Slider Track Styling - Glass/Blur Effect */
.intro-slider-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

/* Webkit (Chrome, Safari, Edge) */
.intro-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.2s ease;
}

.intro-slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 0 0 3px rgba(255, 255, 255, 0.15);
}

.intro-slider-group input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

/* Firefox */
.intro-slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.1);
}

.intro-slider-group input[type="range"]::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
    #intro-editor-modal .intro-editor-container {
        width: 100%;
        max-width: 100%;
        padding: 0 16px;
        justify-content: center;
    }

    .intro-canvas-wrapper {
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        min-height: 60vh;
        /* Aggressive height for mobile portrait photos */
    }

    .intro-gradient-controls {
        padding: 15px 5px;
        gap: 12px;
    }

    .intro-slider-group {
        gap: 10px;
    }

    .intro-slider-label {
        min-width: 35px;
        font-size: 10px;
    }
}