/* =========================================================
   NUJIZ IMAGE WATERMARK PRO
   ========================================================= */

body[data-tool-id] .nujiz-iwm-panel{
    margin:0 0 18px;
    padding:14px;
    border:1px solid #e4dff4;
    border-radius:16px;
    background:#fbfaff;
}

.nujiz-iwm-mode{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-bottom:16px;
}

.nujiz-iwm-mode button{
    min-height:43px;
    border:1px solid #ddd8ed;
    border-radius:11px;
    background:#fff;
    font-family:inherit;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
}

.nujiz-iwm-mode button.active{
    border-color:#7147f7;
    background:#f1edff;
    color:#6843ef;
}

.nujiz-iwm-upload{
    display:block;
    padding:16px;
    text-align:center;
    border:1px dashed #b8a9ef;
    border-radius:13px;
    background:#fff;
    cursor:pointer;
}

.nujiz-iwm-upload strong{
    display:block;
    color:#27283d;
    font-size:12px;
}

.nujiz-iwm-upload small{
    display:block;
    margin-top:6px;
    color:#808397;
    font-size:9px;
}

.nujiz-iwm-upload input{
    display:none;
}

.nujiz-iwm-file-preview{
    display:none;
    margin-top:12px;
    padding:10px;
    align-items:center;
    gap:12px;
    border:1px solid #e6e1f2;
    border-radius:12px;
    background:#fff;
}

.nujiz-iwm-file-preview.visible{
    display:flex;
}

.nujiz-iwm-file-preview img{
    width:64px;
    height:50px;
    object-fit:contain;
    border-radius:8px;
    background:
      linear-gradient(45deg,#eee 25%,transparent 25%),
      linear-gradient(-45deg,#eee 25%,transparent 25%),
      linear-gradient(45deg,transparent 75%,#eee 75%),
      linear-gradient(-45deg,transparent 75%,#eee 75%);
    background-size:12px 12px;
}

.nujiz-iwm-file-preview div{
    min-width:0;
    flex:1;
}

.nujiz-iwm-file-preview strong{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:11px;
}

.nujiz-iwm-file-preview button{
    min-width:34px;
    height:34px;
    border:0;
    border-radius:9px;
    background:#fff1ef;
    color:#9b382e;
    cursor:pointer;
}

.nujiz-iwm-section{
    margin-top:17px;
    padding-top:15px;
    border-top:1px solid #ebe7f4;
}

.nujiz-iwm-section-title{
    display:block;
    margin-bottom:11px;
    color:#22243a;
    font-size:11px;
    font-weight:900;
}

.nujiz-iwm-presets{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:7px;
}

.nujiz-iwm-presets button{
    min-height:38px;
    border:1px solid #ddd8ec;
    border-radius:9px;
    background:#fff;
    font-family:inherit;
    font-size:10px;
    cursor:pointer;
}

.nujiz-iwm-presets button:hover{
    border-color:#7147f7;
    color:#6843ef;
}

.nujiz-iwm-range{
    margin-top:13px;
}

.nujiz-iwm-range label{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:7px;
    font-size:10px;
    font-weight:800;
}

.nujiz-iwm-range input{
    width:100%;
    accent-color:#7147f7;
}


/* overlay */

.nujiz-iwm-overlay{
    position:absolute;
    z-index:80;
    pointer-events:none;
}

.nujiz-iwm-box{
    position:absolute;
    border:2px solid #764cff;
    box-shadow:0 0 0 1px #fff;
    cursor:move;
    pointer-events:auto;
    touch-action:none;
    user-select:none;
}

.nujiz-iwm-box img{
    width:100% !important;
    height:100% !important;
    max-width:none !important;
    max-height:none !important;
    object-fit:contain !important;
    pointer-events:none !important;
    display:block !important;
}

.nujiz-iwm-handle{
    position:absolute;
    width:15px;
    height:15px;
    border:2px solid #fff;
    border-radius:50%;
    background:#7147f7;
    pointer-events:auto;
    touch-action:none;
}

.nujiz-iwm-handle.nw{left:-9px;top:-9px;cursor:nwse-resize}
.nujiz-iwm-handle.ne{right:-9px;top:-9px;cursor:nesw-resize}
.nujiz-iwm-handle.sw{left:-9px;bottom:-9px;cursor:nesw-resize}
.nujiz-iwm-handle.se{right:-9px;bottom:-9px;cursor:nwse-resize}

.nujiz-iwm-rotate{
    position:absolute;
    left:50%;
    top:-39px;
    width:25px;
    height:25px;
    transform:translateX(-50%);
    display:grid;
    place-items:center;
    border:2px solid #fff;
    border-radius:50%;
    background:#7147f7;
    color:#fff;
    font-size:12px;
    pointer-events:auto;
    cursor:grab;
}

.nujiz-iwm-rotate::after{
    content:"";
    position:absolute;
    top:23px;
    width:2px;
    height:14px;
    background:#7147f7;
}

.nujiz-iwm-help{
    margin-top:10px;
    padding:9px 10px;
    border-radius:9px;
    background:#f1edff;
    color:#665c86;
    font-size:9px;
    line-height:1.7;
}

@media(max-width:700px){
    .nujiz-iwm-presets{
        grid-template-columns:repeat(2,1fr);
    }

    .nujiz-iwm-handle{
        width:19px;
        height:19px;
    }
}


/* =========================================================
   NUJIZ WATERMARK FINAL CLEAN LAYOUT
   ========================================================= */

html body .nujiz-iwm-panel{
    width:100% !important;
    display:block !important;
    padding:12px !important;
    margin:10px 0 14px !important;
    box-sizing:border-box !important;
}

/* صف نص / صورة */
html body .nujiz-iwm-mode{
    width:100% !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:8px !important;
    margin:0 0 12px !important;
}

html body .nujiz-iwm-mode button{
    width:100% !important;
    min-width:0 !important;
    height:42px !important;
    min-height:42px !important;
    padding:0 10px !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    writing-mode:horizontal-tb !important;
    text-orientation:mixed !important;

    border:1px solid #ddd8ed !important;
    border-radius:10px !important;

    background:#fff !important;
    color:#25263a !important;
    -webkit-text-fill-color:#25263a !important;

    font-family:inherit !important;
    font-size:12px !important;
    font-weight:900 !important;
}

html body .nujiz-iwm-mode button.active{
    border-color:#7047f5 !important;
    background:#f1edff !important;
    color:#6843ef !important;
    -webkit-text-fill-color:#6843ef !important;
}

/* واجهة الصورة دائما تحت صف النوع */
html body .nujiz-iwm-image-ui{
    width:100% !important;
    display:block !important;
    clear:both !important;
    box-sizing:border-box !important;
}

html body .nujiz-iwm-image-ui[hidden]{
    display:none !important;
}

/* مربع رفع صورة العلامة */
html body .nujiz-iwm-upload{
    width:100% !important;
    max-width:none !important;
    min-height:78px !important;

    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;

    margin:0 0 12px !important;
    padding:14px !important;

    box-sizing:border-box !important;
    float:none !important;
    clear:both !important;
}

/* معاينة الشعار */
html body .nujiz-iwm-file-preview{
    width:100% !important;
    margin:0 0 12px !important;
    box-sizing:border-box !important;
    clear:both !important;
}

/* باقي اعدادات الصورة */
html body .nujiz-iwm-section{
    width:100% !important;
    margin-top:12px !important;
    padding-top:14px !important;
    box-sizing:border-box !important;
    clear:both !important;
}

html body .nujiz-iwm-presets{
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:7px !important;
}

html body .nujiz-iwm-presets button{
    width:100% !important;
    min-width:0 !important;
    min-height:38px !important;
}

html body .nujiz-iwm-range{
    width:100% !important;
    margin-top:14px !important;
}

html body .nujiz-iwm-range input[type="range"]{
    width:100% !important;
}

/* إعدادات النص المخفية في وضع الصورة */
html body .nujiz-iwm-image-active .nujiz-iwm-text-setting{
    display:none !important;
}

/* العناصر المشتركة لا تختفي */
html body .nujiz-iwm-image-active .file-row,
html body .nujiz-iwm-image-active .process-btn,
html body .nujiz-iwm-image-active .download-btn,
html body .nujiz-iwm-image-active .privacy-line{
    display:flex !important;
}

/* لوحة العلامة تبقى عمودية دائما */
html body .nujiz-iwm-image-active .nujiz-iwm-panel{
    display:block !important;
    width:100% !important;
}

/* صف نص / صورة مستقل */
html body .nujiz-iwm-image-active .nujiz-iwm-mode{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    width:100% !important;
    margin-bottom:12px !important;
}

/* اعدادات الصورة تنزل تحت صف النوع */
html body .nujiz-iwm-image-active .nujiz-iwm-image-ui{
    display:block !important;
    width:100% !important;
    clear:both !important;
}

/* اختيار صورة العلامة يأخذ سطر كامل */
html body .nujiz-iwm-image-active .nujiz-iwm-upload{
    display:flex !important;
    width:100% !important;
    max-width:none !important;
    margin:0 0 12px !important;
    clear:both !important;
}

/* بطاقة الصورة الحالية تبقى فوق */
html body #controls > .file-row,
html body .controls-panel > .file-row{
    width:100% !important;
    margin-bottom:10px !important;
}

@media(max-width:600px){
    html body .nujiz-iwm-presets{
        grid-template-columns:1fr 1fr !important;
    }
}
