	/* आइकन्स को बॉटम बार में सही दिखाने के लिए */
.material-symbols-rounded {
    font-size: 28px; /* आइकन का आकार */
    vertical-align: middle;
}
		body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden; /* पेज को ऊपर सरकने से रोकेगा */
    position: fixed; /* मोबाइल पर "Pull to refresh" और बाउंस को रोकेगा */
}
        :root {
            --bg: #fcfcfc; --text: #333; --accent: #2c2c2c; /* सॉफ्ट ब्लैक */
            --tab-bg: #eeeeee; --sidebar-bg: #ffffff; --border: #dddddd;
        }
        body.sepia { --bg: #f4ecd8; --text: #5b4636; --tab-bg: #e2d7b5; --sidebar-bg: #f4ecd8; --accent: #433422; }
        body.night { --bg: #1a1a1a; --text: #e0e0e0; --tab-bg: #333; --sidebar-bg: #222; --accent: #fcfcfc; }

        body, html { 
            margin: 0; padding: 0; height: 100%; width: 100%;
            background-color: var(--bg); color: var(--text);
            font-family: 'Segoe UI', -apple-system, sans-serif; overflow: hidden;
        }

        #app { display: flex; flex-direction: column; height: 100vh; width: 100vw; overflow: hidden;}

        /* टैब बार */
        .tab-container {
			display: flex;
			background: var(--tab-bg);
			border-bottom: 1px solid var(--border);
			overflow: hidden;
		}
		.tab-bar {
				display: flex;
				align-items: center;
				padding: 8px 10px 0 10px;
				gap: 2px;
				overflow-x: auto;
				white-space: nowrap;
				scrollbar-width: none; /* Firefox के लिए स्क्रॉल बार छिपाएं */
		}
		.tab-bar::-webkit-scrollbar { display: none; } /* Chrome के लिए */

/* प्लस बटन जो टैब के साथ चलेगा */
.add-tab-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin-left: 5px;
    margin-bottom: 5px; /* टैब के साथ अलाइन करने के लिए */
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s;
}

.add-tab-inline:hover {
    background: rgba(0,0,0,0.1);
}

.add-tab-inline span { font-size: 20px; }

        .close-btn { margin-left: 5px; opacity: 0.5; font-size: 22px; }
        .close-btn:hover { opacity: 1; color: red; cursor:pointer;}
		.rename-btn {
    font-size: 16px !important;
    opacity: 0.4;
    cursor: pointer;
    margin-left: 5px;
}

.rename-btn:hover {
    opacity: 1;
    color: var(--accent);
}
/* Modal Background */
.modal {
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.6); 
    z-index: 3000;
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--sidebar-bg); 
    padding: 25px;
    border-radius: 15px; 
    width: 85%; 
    max-width: 320px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    color: var(--text);
}

        /* एडिटर एरिया*/
        .content { 
					flex: 1; 
					position: relative; 
					overflow: hidden; 
					margin-bottom: 0; 
					display: flex;
					flex-direction: column;
					padding-bottom: 0px; 
				}
        textarea, #viewer {
            width: 100%; height: 100%; border: none; outline: none;
            padding: 20px; box-sizing: border-box; font-size: 16px;
            background: transparent; color: inherit; line-height: 1.5;
        }
        #viewer { display: none; background: var(--bg); } 

        /* टॉप नेविगेशन बार */
.top-nav {
	flex-shrink: 0;
    height: 60px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 1100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 1px;
}
        .nav-item { font-size: 24px; background: none; border: none; cursor: pointer; color: var(--text); }
        .add-tab-btn { 
            background: #2c2c2c; /* सॉफ्ट ब्लैक */
            color: white; width: 48px; height: 48px; border-radius: 50%; 
            font-size: 28px; display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: 0.2s;
        }
        .add-tab-btn:active { transform: scale(0.9); }
		/* लाइन नंबर कंटेनर */
.editor-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#editor {
    flex: 1;
	height: 100%;
    padding: 15px 10px;
    line-height: 1.5;
    border: none;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: transparent;
    color: var(--text);
    resize: none;
	box-sizing: border-box;
    overflow-y: auto;
	white-space: pre;
	overflow-x: auto;
    box-sizing: border-box;
	-webkit-overflow-scrolling: touch;
}

        /* साइडबार */
        .sidebar {
    position: fixed; 
    top: 0; 
    left: -280px; 
    width: 280px; 
    height: 100%; /* यह viewport की पूरी ऊंचाई लेगा */
    background: var(--sidebar-bg); 
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 2000; 
    padding: 25px; 
    box-sizing: border-box;

    /* स्क्रॉल के लिए ये दो लाइनें जोड़ें */
    overflow-y: auto; 
    overflow-x: hidden; 
}

/* स्क्रॉलबार को थोड़ा सुंदर बनाने के लिए (Optional) */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
        .sidebar.open { left: 0; right: auto; }
        .sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
        .menu-list { display: flex; flex-direction: column; gap: 10px; }
        .menu-list button { 
            padding: 12px 15px; border: 1px solid var(--border); border-radius: 8px; 
            background: transparent; color: inherit; text-align: left; font-size: 15px; 
            display: flex; align-items: center; gap: 12px; cursor: pointer;
        }
        .menu-list button:hover { background: rgba(0,0,0,0.05); }

        /* सर्च बॉक्स */
        #search-box {
            display: none; 
			flex-direction: column; 
			background: var(--sidebar-bg); 
			padding: 10px; 
			border-bottom: 1px solid var(--border); 
			gap: 10px;
			z-index: 1050;
        }
		.search-inputs {
    display: flex;
    gap: 8px;
    width: 100%;
}
.search-inputs input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
}
/* बटन्स का ग्रुप */
.search-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    flex-wrap: wrap; /* मोबाइल पर बटन्स अगली लाइन में जाने के लिए */
}
        
		/* --- मोबाइल के लिए खास बदलाव (@media) --- */
@media (max-width: 768px) {
    .search-inputs {
        flex-direction: column; /* मोबाइल पर Find और Replace ऊपर-नीचे हो जाएंगे */
    }
    
    .search-actions {
        justify-content: space-between;
    }
    
    .search-actions button {
        flex: 1; /* बटन्स मोबाइल पर थोड़े बड़े और क्लिक करने में आसान होंगे */
        padding: 10px 5px;
        font-size: 12px;
    }
}
/* टूलबार और लेआउट फिक्स */
#quick-tools-bar {
    display: none; /* डिफ़ॉल्ट रूप से बंद */
    width: 100%;
    height: 55px; 
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 10px;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center; /* यह बटन्स को बीच में रखेगा */
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 100;
}

/* यह बटन्स को सिकुड़ने से रोकेगा */
#quick-tools-bar button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
/* क्लोज बटन और अन्य आइकन्स */
.close-tools {
    flex-shrink: 0;
    margin-right: 10px;
    padding: 5px 12px;
    color: #ff5f56;
    font-weight: bold;
    font-size: 20px;
    border-right: 1px solid rgba(0,0,0,0.1) !important;
}

/* टूलबार बटन्स की नई स्टाइल */
.tool-btn {
    background: none;
    border: none;
    color: var(--text);
    opacity: 0.7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 8px; /* बटन एरिया बड़ा किया */
}

/* आइकन का साइज */
.tool-btn .material-symbols-rounded {
    font-size: 26px; /* बड़े और स्पष्ट आइकन */
    font-variation-settings: 'Wght' 400; /* मध्यम मोटाई */
}

.tool-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05); /* हल्का सा बैकग्राउंड हाईलाइट */
    border-radius: 8px;
}

.tool-btn:active {
    transform: scale(0.9); /* दबाने पर छोटा सा रिस्पॉन्स */
}

/* बॉटम टूलबार स्टाइल */
.bottom-tools {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    padding: 5px;
    gap: 4px;
    z-index: 2500;
    /* मोबाइल स्मूथनेस के लिए */
    transform: translateZ(0); 
    transition: bottom 0.1s ease-out;
}

.bottom-tools::-webkit-scrollbar { display: none; }

.k-btn {
    min-width: 45px;
    height: 40px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* फ्लोटिंग टॉगल बटन */
#toggle-kb-tools {
    position: fixed;
    right: 15px;
    bottom: 60px; /* डिफ़ॉल्ट */
    z-index: 2600;
    transition: bottom 0.1s ease-out;
}

#view-mode-tools {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 15px;
    z-index: 3000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#view-mode-tools button {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    gap: 2px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

/* डेस्कटॉप मोड के लिए आईफ्रेम की चौड़ाई बदलना */
.desktop-view {
    width: 1280px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    border: 1px solid #333 !important;
    border-radius: 10px;
}
.custom-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 20000; /* साइडबार से भी ऊपर */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg);
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    /* नीचे वाली लाइन सबसे जरूरी है */
    box-sizing: border-box; 
    display: block; /* ब्लॉक एलिमेंट सुनिश्चित करें */
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-buttons button.primary {
    background: #2196F3;
    color: white;
}

.color-picker-wrapper {
    display: inline-block;
}

.color-picker-wrapper button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}
.CodeMirror {
    height: 100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: transparent;
}

.editor-wrapper {
    flex: 1;
    overflow: hidden;
}

.CodeMirror-matchingbracket {
    background: rgba(0, 150, 255, 0.15);
    border-bottom: 2px solid #0096ff;
}

#viewer {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    transform-origin: top left;
    transition: all 0.25s ease;
}

#viewer.desktop-view {
    width: 1280px !important; 
    max-width: none !important; 
    transform-origin: top left;
}

.content {
    overflow: hidden; 
}
 