.framing-plugin * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.framing-plugin {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: transparent;
    padding: 10px 0;
    display: flex;
    justify-content: center;
}

.framing-plugin .container {
    max-width: 1400px;
    width: 100%;
}

/* Main layout - horizontal with frame in center */
.framing-plugin .frame-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
}

@media (max-width: 1200px) {
    .framing-plugin .frame-container {
        flex-wrap: wrap;
    }
}

.framing-plugin .meditation-frame {
    position: relative;
    width: auto;
    height: auto;
    background-image: var(--frame-default, url('filter5.png'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    order: 2;
    flex-shrink: 0;
}

/* Portrait frame style (9:16) */
.framing-plugin .meditation-frame[data-frame-type="portrait"] {
    max-width: 350px;
    max-height: 622px;
}

/* Square frame style (1:1) */
.framing-plugin .meditation-frame[data-frame-type="square"] {
    max-width: 450px;
    max-height: 450px;
}

/* Frame background overlay */
.framing-plugin .frame-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--frame-default, url('filter5.png'));
    background-size: cover;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

/* Photo Upload Area */
.framing-plugin .photo-upload-area {
    position: absolute;
    top: var(--upload-top, 10%);
    left: var(--upload-left, 5%);
    width: var(--upload-width, 90%);
    height: var(--upload-height, 62%);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 2px dashed transparent;
    touch-action: none;
    z-index: 3; /* keep upload target above the illustration overlay */
}

.framing-plugin .photo-upload-area:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.framing-plugin .photo-upload-area.dragover {
    background: rgba(230, 247, 255, 0.3);
    border: 2px dashed #2196F3;
}

.framing-plugin .upload-placeholder {
    text-align: center;
    padding: 20px;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 2px dashed #ccc;
    pointer-events: none;
}

.framing-plugin .upload-placeholder:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #999;
}

.framing-plugin .upload-icon {
    margin-bottom: 10px;
    color: #666;
}

.framing-plugin .upload-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.framing-plugin .upload-subtext {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.framing-plugin .file-support {
    font-size: 10px;
    color: #999;
}

.framing-plugin #userPhoto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: none;
    z-index: 1;
    touch-action: none;
    border-radius: 20px;
}

/* Gesture Instructions Styling */
.framing-plugin .gesture-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.framing-plugin .gesture-instructions p {
    margin: 0 0 8px 0;
    color: #495057;
}

.framing-plugin .gesture-instructions p:last-child {
    margin-bottom: 0;
}

.framing-plugin .gesture-instructions strong {
    color: #6A1B9A;
    font-weight: 600;
}

/* Controls Panel - Right side */
.framing-plugin .controls-panel {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 280px;
    order: 3;
    flex-shrink: 0;
}

.framing-plugin .controls-panel h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 18px;
    text-align: center;
}

/* Frame Selection Panel - Left side */
.framing-plugin .frame-selection-panel {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 280px;
    order: 1;
    flex-shrink: 0;
}

.framing-plugin .frame-selection-panel h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.framing-plugin .frame-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.framing-plugin .frame-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-width: 70px;
}

.framing-plugin .frame-option:hover {
    border-color: #6A1B9A;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 27, 154, 0.2);
}

.framing-plugin .frame-option.active {
    border-color: #6A1B9A;
    background: rgba(106, 27, 154, 0.05);
}

.framing-plugin .frame-option img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 5px;
}

.framing-plugin .frame-option span {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.framing-plugin .frame-option.active span {
    color: #6A1B9A;
    font-weight: 600;
}

.framing-plugin .control-group {
    margin-bottom: 10px;
}

.framing-plugin .control-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.framing-plugin .value-display {
    color: #6A1B9A;
    font-weight: 700;
    font-size: 13px;
}

.framing-plugin .control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.framing-plugin .control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6A1B9A;
    cursor: pointer;
    transition: all 0.2s ease;
}

.framing-plugin .control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #4A148C;
    transform: scale(1.1);
}

.framing-plugin .button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.framing-plugin .btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.framing-plugin .btn-primary {
    background: #6A1B9A;
    color: white;
}

.framing-plugin .btn-primary:hover {
    background: #4A148C;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 27, 154, 0.3);
}

.framing-plugin .btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.framing-plugin .btn-secondary:hover {
    background: #e9ecef;
    border-color: #ccc;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .framing-plugin .container {
        padding: 10px;
    }
    
    .framing-plugin .frame-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .framing-plugin .frame-selection-panel {
        order: 1;
    }
    
    .framing-plugin .meditation-frame {
        order: 2;
    }
    
    .framing-plugin .controls-panel {
        order: 3;
    }
    
    .framing-plugin .meditation-frame[data-frame-type="portrait"] {
        width: min(92vw, 300px);
        height: auto;
        max-height: calc(100vh - 140px);
    }
    
    .framing-plugin .meditation-frame[data-frame-type="square"] {
        width: min(92vw, 320px);
        height: auto;
        max-height: calc(100vh - 140px);
    }
    
    .framing-plugin .photo-upload-area {
        width: 82%;
        height: 58%;
        left: 9%;
        top: 18%;
    }
    
    .framing-plugin .frame-selection-panel {
        width: 100%;
        padding: 15px;
        max-width: none;
    }
    
    .framing-plugin .frame-selection-panel h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .framing-plugin .frame-options {
        gap: 8px;
        justify-content: center;
    }
    
    .framing-plugin .frame-option {
        min-width: 65px;
        padding: 8px 6px;
    }
    
    .framing-plugin .frame-option img {
        width: 45px;
        height: 45px;
    }
    
    .framing-plugin .frame-option span {
        font-size: 11px;
    }
    
    .framing-plugin .controls-panel {
        width: 100%;
        padding: 14px;
        max-width: none;
        min-width: unset;
    }
    
    .framing-plugin .controls-panel h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .framing-plugin .gesture-instructions {
        padding: 12px;
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .framing-plugin .control-group {
        margin-bottom: 10px;
    }
    
    .framing-plugin .control-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .framing-plugin .value-display {
        font-size: 12px;
    }
    
    .framing-plugin .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .framing-plugin .button-group {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .framing-plugin .container {
        padding: 8px;
    }
    
    .framing-plugin .frame-selection-panel {
        order: 1;
    }
    
    .framing-plugin .meditation-frame {
        order: 2;
    }
    
    .framing-plugin .controls-panel {
        order: 3;
    }
    
    .framing-plugin .meditation-frame[data-frame-type="portrait"] {
        width: min(96vw, 280px);
        height: auto;
        max-height: calc(100vh - 120px);
    }
    
    .framing-plugin .meditation-frame[data-frame-type="square"] {
        width: min(96vw, 300px);
        height: auto;
        max-height: calc(100vh - 120px);
    }
    
    .framing-plugin .photo-upload-area {
        width: 85%;
        height: 65%;
        left: 7.5%;
        top: 17.5%;
    }
    
    .framing-plugin .frame-selection-panel {
        padding: 12px;
    }
    
    .framing-plugin .frame-selection-panel h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .framing-plugin .frame-options {
        gap: 6px;
    }
    
    .framing-plugin .frame-option {
        min-width: 55px;
        padding: 6px 4px;
    }
    
    .framing-plugin .frame-option img {
        width: 38px;
        height: 38px;
    }
    
    .framing-plugin .frame-option span {
        font-size: 10px;
    }
    
    .framing-plugin .controls-panel {
        padding: 12px;
        max-width: none;
        min-width: unset;
    }
    
    .framing-plugin .controls-panel h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .framing-plugin .gesture-instructions {
        padding: 10px;
        font-size: 11px;
        margin-bottom: 12px;
    }
    
    .framing-plugin .control-group {
        margin-bottom: 12px;
    }
    
    .framing-plugin .control-group label {
        font-size: 12px;
    }
    
    .framing-plugin .value-display {
        font-size: 11px;
    }
    
    .framing-plugin .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
