@font-face {
    font-family: 'SolaimanLipi';
    src: url('https://cdn.jsdelivr.net/gh/ShahjalalShohag/solaiman-lipi-font@main/SolaimanLipi-Bold.ttf') format('truetype');
    font-weight: bold;
}

body {
    margin:0;
    background:#111;
    color:#fff;
    font-family:'SolaimanLipi', sans-serif;
    font-weight:bold;
}

.editor {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}
.preview {
    flex: 1; /* এটি স্ক্রিনের বেশি জায়গা নেবে */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-width: 0; /* এটি খুব জরুরি যেন টুলবক্স বড় হলে এটি ছোট হতে পারে */
    background: #000; 
    position: relative;
}
.canvas {
    width: 360px; 
    height: 640px; 
    position: relative; 
    overflow: hidden; 
    flex-shrink: 0; /* যেন ক্যানভাস নিজে চুপসে না যায় */
    background: #000;
    transform: scale(0.9); /* যদি স্ক্রিনে না আটে তবে এটি ০.৮ বা ০.৯ করে দিন */
}
/* Background */
.bgContainer{position:absolute; top:0; left:0; width:100%; height:100%; z-index:0;}
.bgContainer video{width:100%; height:100%; object-fit:cover;}

/* Frame */
/* ভিডিও ফ্রেমটি উপরে তোলার জন্য আপডেট */
.frame {
position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;      /* ভিডিওর জন্য ৭০% জায়গা */
    overflow: hidden; /* জানালার বাইরের অংশ দেখা যাবে না */
    background: #000; /* ভিডিওর পেছনে কালো ব্যাকগ্রাউন্ড */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.frame video {
width: 100%;      /* ফ্রেমের চওড়া অনুযায়ী */
    height: auto;     /* ভিডিওর নিজের উচ্চতা অনুযায়ী */
    display: block;
    transform-origin: center; /* একদম মাঝখান থেকে জুম হবে */
    transition: none; /* এডিটিং এর সময় কোনো দেরি হবে না */
    
}



    
    

/* Ad Banner */
.adBanner{position:absolute; bottom:5%; left:0; right:0; display:none; justify-content:center; align-items:center; z-index:2; background:transparent;}
.adBanner img{width:100%; height:100%; object-fit:contain;}

/* Logo, GIF, Source, Title, Sub */
.logo{position:absolute; top:10px; right:10px; width:100px; z-index:3;}
.gif{position:absolute; top:10px; left:10px; width:100px; z-index:3;}
.source{position:absolute; bottom:10px; left:10px; font-size:10pt; color:white; background:black; padding:2px 5px; border-radius:3px; z-index:3;}
/* টাইটেল সেন্টার করার জন্য আপডেট */
.title {
    position: absolute;
    bottom: 65px;
    width: 90%;          /* স্ক্রিনের ৯০% জায়গা নেবে */
    left: 50%;           /* বাম দিক থেকে ৫০% দূরে থাকবে */
    transform: translateX(-50%); /* নিজের সাইজের অর্ধেক বামে সরিয়ে একদম মাঝখানে আনবে */
    
    text-align: center;  /* ভেতরের লেখাকে মাঝখানে রাখবে */
    font-size: 25px;
    font-weight: bold;
    color: white;
    z-index: 3;
    overflow: hidden;
    white-space: pre-wrap;
}.sub{position:absolute; bottom:10px; left:50%; transform:translateX(-50%); font-weight:bold; color:black; background:linear-gradient(90deg, #FFEA00,#FFD700); padding:5px 10px; border-radius:5px; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; animation:pulseText 3s infinite ease-in-out; z-index:3;}
@keyframes pulseText{0%,100%{transform:translateX(-50%) scale(1); opacity:1;}50%{transform:translateX(-50%) scale(1.05); opacity:0.9;}}

/* Toolbox */
.toolbox {
    width: 350px; /* শুরুর উইডথ */
    min-width: 200px;
    max-width: 100vw;
    background: #1a1a1a;
    flex-shrink: 0; /* এটি টুলবক্সকে অটো ছোট হতে বাধা দেবে */
    display: flex;
    flex-direction: column;
}
.controls{padding:10px; border-bottom:1px solid #333; position: relative;}
.controls input,.controls textarea,.controls button{margin-bottom:8px; padding:8px; border:none; border-radius:5px; width:100%;}
button{background:#e50914; color:#fff; cursor:pointer;}
.source-row{display:flex; align-items:center; gap:5px; margin-bottom:8px;}
.source-row input{flex:1; padding:8px; border-radius:5px; border:none;}
.eye-toggle{width:30px; height:30px; cursor:pointer; border:2px solid #fff; border-radius:50%; display:flex; justify-content:center; align-items:center;}
.eye-toggle::after{content:''; width:14px; height:2px; background:#fff; transform:rotate(45deg); display:none;}
.eye-off .eye-toggle::after{display:block;}
.timeline {
    flex: none; /* ফ্লেক্স গ্রো বন্ধ */
    height: 120px; /* হাইট কিছুটা বাড়ানো টাচ সুবিধার জন্য */
    background: #1a1a1a;
    position: relative;
    overflow-x: auto; /* হরাইজন্টাল স্ক্রল */
    overflow-y: hidden;
    white-space: nowrap; /* ক্লিপগুলো এক লাইনে থাকবে */
    display: flex; /* ক্লিপগুলো একটার পর একটা বসার জন্য */
    align-items: center;
    padding: 10px;
    border-top: 1px solid #333;
    scroll-behavior: smooth;
}
.timeline::-webkit-scrollbar {
    height: 6px;
}
.timeline::-webkit-scrollbar-thumb {
    background: #e50914;
    border-radius: 10px;
}

.clip {
    display: inline-flex;
    flex-shrink: 0; /* ক্লিপ যেন ছোট হয়ে না যায় */
    height: 70px;
    background: #0b84ff;
    margin-right: 4px; /* একটার পর একটা গ্যাপ */
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    border: 2px solid transparent;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.clip.selected {
    border-color: #fff;
    background: #e50914;
}

.playhead {
    position: absolute;
    width: 2px;
    background: #ff0000;
    height: 100%; /* পুরো টাইমলাইন জুড়ে */
    top: 0;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255,0,0,0.5);
}
.resizer {
    width: 8px; /* একটু চওড়া করলাম ধরার সুবিধার জন্য */
    cursor: col-resize;
    background: #333;
    z-index: 100;
}
.resizer:hover { background: #e50914; }



/* On/Off সুইচের স্টাইল */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #444; transition: .4s; border-radius: 20px;
}
.slider:before {
  position: absolute; content: ""; height: 14px; width: 14px;
  left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #e50914; }
input:checked + .slider:before { transform: translateX(20px); }






/* --- Mobile Specific Responsive CSS --- */
@media (max-width: 768px) {
    .editor {
        flex-direction: column; /* ওপর-নিচে লেআউট */
    }

    .preview {
        flex: 0 0 50vh; /* স্ক্রিনের ঠিক অর্ধেক জায়গা ফিক্সড */
        width: 100%;
        height: 50vh;
        background: #000;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow: hidden;
        z-index: 10;
        border-bottom: 2px solid #333;
    }

    .canvas {
        /* JS দিয়ে স্কেল হবে, তাই অরিজিন সেন্টারে রাখা জরুরি */
        transform-origin: center center;
        flex-shrink: 0;
    }

    .resizer {
        display: none; /* মোবাইলে ড্র্যাগ করার দরকার নেই */
    }

    .toolbox {
        flex: 1; /* বাকি অর্ধেক জায়গা নেবে */
        width: 100% !important;
height: auto; /* ফিক্সড হাইট সরিয়ে অটো দিন */
max-height: 50vh;
overflow-y: auto; /* টুলবক্সের ভেতর স্ক্রল হবে */
        background: #1a1a1a;
        padding: 15px;
        box-sizing: border-box;
    }

    /* মোবাইল টাচ এর জন্য ইনপুট সাইজ ঠিক করা */
    .controls input, .controls textarea, .controls button {
        min-height: 40px;
        font-size: 16px !important; /* জুম সমস্যা এড়াতে */
        margin-bottom: 10px;
    }

    .timeline {
height: 100px;
        min-height: 100px; /* মোবাইলে জায়গা ফিক্সড রাখা */    }
}