#wrapper { width:100%; max-width: 800px; margin: auto; position: relative; --primary: #007bff; --success: #28a745; font-family: sans-serif; padding: 12px; background: #F5F5F5; border-radius: 4px; border: 1px solid #d1d5db; }

#wrapper .toolbar { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 10px; 
    align-items: center; 
    justify-content: space-between; 
}

/* Forced override for Joomla Textarea issues */
#wrapper textarea { 
    font-family: "Calibri", "Segoe UI", Roboto, sans-serif !important;
    width: 100% !important; 
    height: 300px; 
    padding: 22px !important; 
    border: 2px solid #d1d5db !important; 
    border-radius: 4px !important; 
    font-size: 21px !important; 
    line-height: 1.6 !important; 
    box-sizing: border-box !important; 
    outline: none !important; 
    display: block !important; 
    background: #ffffff !important; 
    color: #1a1a1a !important;
    transition: all 0.2s ease-in-out !important;
    margin: 0 !important;
}

#wrapper textarea:focus {
    border: 2px solid #007bff !important; 
    background: #fff !important;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2) !important;
}

#wrapper #mobile_helper { background: #eee; border-top: 1px solid #d1d5db;border-left: 1px solid #d1d5db;border-right: 1px solid #d1d5db; border-bottom: 0px; border-radius: 4px 4px 0px 0px; padding: 8px; display: flex; gap: 8px; overflow-x: auto; min-height: 45px; align-items: center; white-space: nowrap; -webkit-overflow-scrolling: touch; font-family: fangsong;}

#wrapper .suggestion-btn { background: white; color:black; border: 1px solid #ccc; padding: 8px 18px; border-radius: 4px; font-size: 16px; cursor: pointer; flex-shrink: 0; }


#wrapper #mirror { visibility: hidden; position: absolute; white-space: pre-wrap; width: 100%; font-size: 18px; padding: 15px; pointer-events: none; word-wrap: break-word; }

#wrapper button { all: initial; padding: 5px 7px; border: none; border-radius: 4px; color: white; cursor: pointer; }

#wrapper .btn-copy { background: var(--primary); }
#wrapper .mode-ml { background: var(--success); }
#wrapper .mode-en { background: #dc3545; }
/*
#wrapper .action-toolbar { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }

#wrapper .action-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 5px;
    border: none !important;
    cursor: pointer;
    transition: 0.3s;
    background: #f0f0f0;
}

#wrapper .action-toolbar button svg { width: 26px; height: 26px; fill: white; }
#wrapper .action-toolbar button:hover { transform: scale(1.1); filter: brightness(90%); } */

#wrapper #counter-overlay {
    position: absolute;
    bottom: 8px;
    right: 15px;
    font-size: 12px;
    color: #888;
    background: rgba(255, 255, 255, 0.7); /* Semi-transparent */
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none; /* User can click through it to type */
    border: none !important; /* Removed border to look cleaner inside box */
    font-weight: normal;
    z-index: 5;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

#wrapper #voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
}

#wrapper .recording {
    background: #dc3545 !important;
    animation: pulse 1.5s infinite;
}

#wrapper .toolbar-right { display: flex; align-items: center; gap: 10px; }
#wrapper .toolbar-buttons { display: flex; gap: 10px; }

#wrapper .editor-container {
    position: relative;
    width: 100%;
}
#wrapper textarea#input_tool { 
    font-family: 
        'Apple Color Emoji',     /* Best look for Apple users */
        'Segoe UI Emoji',       /* Standard Windows color emojis */
        'Segoe UI Symbol',      /* Fallback */
        'Noto Color Emoji',     /* High-quality Android/Linux style */
        'Meiryo',               /* Clean Japanese/Global fallback */
        sans-serif;             /* Base font */
    width: 100% !important; 
    height: 280px; 
    padding: 22px 22px 32px 22px !important; /* Extra bottom padding for counter */
    border: 1px solid #d1d5db !important; 
    border-radius: 4px !important; 
    font-size: 21px !important; 
    line-height: 1.6 !important; 
    box-sizing: border-box !important; 
    outline: none !important; 
    display: block !important; 
    background: #ffffff !important; 
    color: #1a1a1a !important;
    transition: all 0.2s ease-in-out !important;
    margin-bottom: 0 !important;
}

/* Position the menu relatively so the close button can anchor to its corner */
#TransliterationHelpMenu {
    position: relative; 
    margin-top: 15px;
    padding: 15px; /* Extra padding to ensure close button doesn't overlap text */
    border: 1px solid #ccc;
    background: #fff;
	border-radius: 4px;
}

/* Absolute positioning keeps it from taking up a whole row */
#TransliterationHelpMenuClose {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
}

/* Optional: Make the close button look cleaner */
#CloseTransliterationHelp {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0 5px;
}

 #TransliterationHelp {
        cursor: pointer;
        border-radius: 4px;
        transition: opacity 0.2s;
    }
    #TransliterationHelp:hover { opacity: 0.9; }

/* Help Keyboard Button CSS */
#wrapper .btn11 {
	display: inline-block;
	padding: 4px 10px 4px;
	margin-bottom: 0;
	font-size: 13px;
	line-height: 18px;
	color: #333;
	text-align: center;
	text-shadow: 0 1px 1px rgba(255, 255, 255, .75);
	vertical-align: middle;
	cursor: pointer;
	background-color: #f5f5f5;
	background-image: -ms-linear-gradient(top, #fff, #e6e6e6);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e6e6e6));
	background-image: -webkit-linear-gradient(top, #fff, #e6e6e6);
	background-image: -o-linear-gradient(top, #fff, #e6e6e6);
	background-image: linear-gradient(to top, #fff, #e6e6e6);
	background-image: -moz-linear-gradient(top, #fff, #e6e6e6);
	background-repeat: repeat-x;
	border: 1px solid #ccc;
	border-color: rgba(0, 0, 0, .1) rgba(0, 0, 0, .1) rgba(0, 0, 0, .25);
	border-color: #e6e6e6 #e6e6e6 #bfbfbf;
	border-bottom-color: #b3b3b3;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05)
}

#wrapper .btn11:hover {
	color: #333;
	text-decoration: none;
	background-color: #e6e6e6;
	background-position: 0 -15px;
	-webkit-transition: background-position .1s linear;
	-moz-transition: background-position .1s linear;
	-ms-transition: background-position .1s linear;
	-o-transition: background-position .1s linear;
	transition: background-position .1s linear
}

#wrapper .btn11:focus {
	outline: thin dotted #333;
	outline: 5px auto -webkit-focus-ring-color;
	outline-offset: -2px
}

#wrapper .btn11:active {
	background-color: #e6e6e6;
	background-image: none;
	outline: 0;
	-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .05)
}

/* Standard Top Nav Container */
#wrapper .top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0px; /* Tabs touch each other */
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd; /* Subtle line under all tabs */
}

/* Base style for all links */
#wrapper .top-nav span {
    padding: 5px 12px;
    font-size: 16px;
    border: 1px solid transparent;
    margin-bottom: -1px; /* Overlaps container border */
}

/* ACTIVE TAB: Blue with solid look */
#wrapper .menu2 {
    background-color: #337ab7 !important;
    color: #ffffff !important;
    border: 1px solid #337ab7 !important;
    border-bottom-color: transparent !important;
    border-radius: 4px 4px 0 0;
    font-weight: bold;
}

/* INACTIVE TABS: Gray with subtle hover */
#wrapper .menu1 {
    background-color: #f8f8f8;
    border: 1px solid #ddd !important;
    border-radius: 4px 4px 0 0;
    margin-right: 2px;
}

#wrapper .menu1 a {
    color: #337ab7;
    text-decoration: none;
}

#wrapper .menu1:hover {
    background-color: #eee;
}

/* MODE SELECTION: Clean spacing */
#wrapper .mode-selection {
/*  padding: 5px 5px;
	background: #fcfcfc;
    border: 1px solid #eee; */
    margin-bottom: 5px;
    text-align: center;
	font-size: medium;
}

#mirror {
    position: absolute;
    top: -9999px; /* Keep it off-screen but still measurable */
    left: -9999px;
    z-index: -1;
    overflow: hidden;
}

#input_tool_helper {
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-width: 150px;
    padding: 0;
    margin: 0;
}

#wrapper .suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#wrapper .suggestion-item {
  /*  padding: 8px 12px; */
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

#wrapper .suggestion-item.selected, .suggestion-item:hover {
    background-color: #4f46e5;
    color: #fff;
}

/* Base Icon Style (Hidden by default) */
#wrapper .nav-icon {
    display: none;
    width: 20px;
    height: 20px;
    fill: #337ab7;
    vertical-align: middle;
}

@media screen and (max-width: 650px) {
	
	#wrapper { padding: 10px; }
	
	#wrapper .top-nav span {
    padding: 7px 8px;
    font-size: 12px;
    border: 1px solid transparent;
    margin-bottom: -1px; /* Overlaps container border */
}
    /* Hide long text in Nav */
    #wrapper .nav-text { display: none; }
    
    /* Show icons in Nav */
    #wrapper .nav-icon { display: inline-block; }
    
    /* Make Nav items look like square buttons on mobile */
    #wrapper .nav-icon-btn {
        padding: 8px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

	#wrapper .mobile-hide {
        display: none !important;
    }
    /* Handle Mode Selection space: Show only 2 most important on one line */
    #wrapper .mode-selection label {
        font-size: 12px;
        display: inline-flex;
        align-items: center;
    }
	
	#wrapper textarea#input_tool { 
    border-radius: 0px 0px 4px 4px !important;
}
    
    /* Hide extra modes completely to keep caret positioning clean */
    #character, #simple, 
    label[for="character"], label[for="simple"] {
        display: none !important;
    }
}

/* Ensure the parent container can hold absolute elements */
#wrapper .editor-container {
    position: relative; 
    min-height: 200px; /* Adjust based on your textarea height */
}

#loader-wrapper {
    position: absolute; /* Changed from fixed to absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9); /* Slight transparency looks better */
    z-index: 10; /* Lower z-index since it's just over the textarea */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px; /* Match your textarea corners */
    transition: opacity 0.3s ease;
}

#wrapper .loader-content p {
    font-size: 14px;
    color: #337ab7;
    margin-top: 8px;
}



#wrapper .action-toolbar {
    display: flex;
   /* max-width: 750px; */
    margin: 12px 0px 12px 0px;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

#wrapper .action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #337ab7;
    /* The "Pop" - Shadow and Border */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 2px;
    color: white;
    cursor: pointer;
    min-width: 0;
    transition: all 0.1s ease;
}

/* Hover & Active Effects */
#wrapper .action-btn:hover {
    background: #286090;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

#wrapper .action-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

#wrapper .action-btn svg {
    width: 22px;
    height: 22px;
    fill: white;
    margin-bottom: 2px;
}

#wrapper .btn-text {
    font-size: 13px;
    line-height: 1.1;
    text-align: center;
    font-family: sans-serif;
    font-weight: 500;
}

/* DESKTOP: One row, Text Only */
@media (min-width: 768px) {
    #wrapper .action-toolbar {
        flex-wrap: nowrap;
    }
    #wrapper .action-btn svg {
        display: none;
    }
    #wrapper .btn-text {
        display: block;
    }
}

/* MOBILE: 5 icons per row, No Text */
@media (max-width: 650px) {
    #wrapper .action-toolbar {
        flex-wrap: wrap; 
        padding: 0 0px; /* Reduced side padding */
        gap: 5px; /* Tight gap to ensure 5 fit across */
        justify-content: space-between;
    }
    
    #wrapper .action-btn {
        /* (100% - total gaps) / 5 buttons */
        flex: 0 0 calc(20% - 4px); 
        box-sizing: border-box; /* Ensures border/padding don't add to width */
        padding: 12px 0;
    }

    #wrapper .btn-text {
        display: none; 
    }

    #wrapper .action-btn svg {
        display: block;
        width: 24px;
        height: 24px;
        margin-bottom: 0;
    }

    /* Force Tooltip visibility on Tap */
    #wrapper .action-btn:active::after,
    #wrapper .action-btn:active::before {
        opacity: 1;
        visibility: visible;
    }
}


/* Tooltip Container Base */
#wrapper .action-btn {
    position: relative; /* Required for tooltip positioning */
    -webkit-tap-highlight-color: transparent; /* Clean touch on Android */
}

/* Tooltip Styling */
#wrapper .action-btn::after {
    content: attr(title); /* Automatically pulls text from the 'title' attribute */
    position: absolute;
    bottom: 120%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none; /* Don't interfere with clicks */
}

/* Tooltip Arrow */
#wrapper .action-btn::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

/* Trigger on Long-Press (Mobile) and Hover (Desktop) */
@media (max-width: 650px) {
    /* On mobile, we use :active or :focus to simulate the long-press feel */
    #wrapper .action-btn:active::after,
    #wrapper .action-btn:active::before {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

@media (min-width: 768px) {
    /* Standard hover for desktop */
    #wrapper .action-btn:hover::after,
    #wrapper .action-btn:hover::before {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

#wrapper h5
	{
		font-size:small;
		margin-top: 10px;
		margin-bottom: 6px;
		line-height: 1.5;
	}
	
#wrapper .emoji-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

#wrapper #emoji_btn {
    font-size: 25px;
    background: none;
    /* border: 1px solid #ddd; */
    border-radius: 50%;
    cursor: pointer;
    /* padding: 5px; */
    transition: transform 0.2s;
    position: relative;
    right: 196px;
    bottom: 7px;
}

#wrapper #emoji_btn:hover { transform: scale(1.1); }

/* Container for the Picker */
#wrapper #picker_container {
    position: absolute;
    z-index: 9999;
    display: block;
	right:80px;
	
    
    /* 2026 Glassmorphism Styling */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    overflow: hidden;
    transition: opacity 0.2s ease;
}

#wrapper em-emoji-picker {
    --border-radius: 5px;
    --shadow: none;
    height: 400px;
    max-width: 350px;
}

#wrapper .hidden { display: none !important; }

/* Hide feature on mobile as keyboards handle emojis there */
@media (max-width: 750px) {
    #emoji_btn, #picker_container {
        display: none !important;
    }
}
