/* --- 1. Isolation Wrapper (Joomla Safety) --- */
.v-voice-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.v-voice-wrapper * {
    box-sizing: border-box;
}

/* --- 2. Container Box --- */
.v-voice-wrapper .boxed {
    background-color: #B9E5F3;
    width: 100%;
    max-width: 800px;
    padding: 10px;
    margin: 0 auto;
    border: 1px solid #51A2D9;
    border-radius: 2px;
}

/* --- 3. Header & Controls --- */
.v-voice-wrapper .header-control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto 15px auto;
    gap: 15px;
}

.v-voice-wrapper .lang-selection {
    display: flex;
    gap: 8px;
    flex: 1;
}

.v-voice-wrapper .lang-selection select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    /* Fixed SVG with correct xmlns and encoded color */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232a6592' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
   background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    border: 1px solid #51A2D9;
    border-radius: 8px;
    padding: 10px 35px 10px 15px;
    font-size: 14px;
    color: #2a6592;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
}




.v-voice-wrapper .lang-selection select:focus {
    outline: none;
    border-color: #2a6592;
    box-shadow: 0 0 0 3px rgba(81, 162, 217, 0.2);
}

.v-voice-wrapper #div_start {
    flex: 0 0 auto;
}

.v-voice-wrapper #start_button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

/* --- 4. Text Areas (Final & Results) --- */
.v-voice-wrapper #results, 
.v-voice-wrapper #final_span {
    background-color: white;
    font-family: 'Cambria', serif;
    font-size: 18px;
    border: 1px solid #51A2D9;
    padding: 12px;
    width: 100%;
    max-width: 760px;
    margin: 10px auto;
    display: block;
    border-radius: 4px;
}

.v-voice-wrapper #results { 
    min-height: 55px; 
    color: #666; 
    font-size: 15px; 
}

.v-voice-wrapper #final_span { 
    min-height: 250px; 
    resize: vertical; 
    line-height: 1.6; 
}

/* --- 5. Suggestion Bar --- */
.v-voice-wrapper #input_tool_helper {
    background-color: #f9f9f9;
    border: 1px dashed #51A2D9;
    padding: 0 12px;
    width: 100%;
    max-width: 760px;
    margin: 10px auto;
    border-radius: 4px;
    min-height: 54px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.v-voice-wrapper #input_tool_helper[hidden] {
    display: none !important;
}

.v-voice-wrapper .btnSugg {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 15px;
    font-size: 14px;
    border: 1px solid #2a6592;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

/* --- 6. Button Grid (Desktop & Mobile Sync) --- */
.v-voice-wrapper .grid-container1 {
    display: grid;
    grid-template-columns: repeat(6, 1fr) !important; /* मोबाइल पर भी 6 ही रहेंगे */
    gap: 8px;
    max-width: 760px;
    margin: 15px auto 0 auto;
    padding: 0;
}

.v-voice-wrapper .btncustom {
    background-color: #2a6592;
    color: white;
    padding: 10px 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column; /* आइकन ऊपर, टेक्स्ट नीचे */
    align-items: center;
    justify-content: center;
    font-size: 11px;
    width: 100%;
    transition: background 0.3s;
	position: relative;
}

/* --- Tooltip Design (Hidden by default) --- */
.v-voice-wrapper .btncustom {
    position: relative; /* Required for absolute positioning of tooltip */
}

.v-voice-wrapper .btncustom::after {
    content: attr(data-v-title); /* Pulls text from our custom attribute */
    position: absolute;
    bottom: 125%; /* Appears above the button */
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Arrow for the tooltip */
.v-voice-wrapper .btncustom::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: 9999;
}

/* Class added by JS on Long Press */
.v-voice-wrapper .btncustom.show-v-tip::after,
.v-voice-wrapper .btncustom.show-v-tip::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}


.v-voice-wrapper .btncustom i {
    font-size: 18px;
    margin-bottom: 2px;
}

.v-voice-wrapper .btncustom:hover { background-color: #1d4666; }

/* --- 7. Media Queries (Mobile Specific) --- */
@media screen and (max-width: 600px) {
    .v-voice-wrapper .header-control-row {
        flex-direction: column;
        text-align: center;
    }

    .v-voice-wrapper #div_start { order: -1; }

    .v-voice-wrapper .lang-selection {
        width: 100%;
    }

    .v-voice-wrapper .grid-container1 {
        gap: 4px; /* मोबाइल पर जगह कम */
    }

    /* मोबाइल पर टेक्स्ट पूरी तरह गायब - सिर्फ आइकन्स */
    .v-voice-wrapper .btncustom span {
        display: none !important; 
    }

    .v-voice-wrapper .btncustom i {
        font-size: 22px; /* मोबाइल पर आइकन थोड़े बड़े */
        margin-bottom: 0;
    }

    .v-voice-wrapper .btncustom {
        padding: 12px 0;
    }
	
	 .v-voice-wrapper .lang-selection select {
        padding: 12px 35px 12px 12px;
        font-size: 15px;
    }
}

/* Custom Scrollbar for Suggestion Helper */
.v-voice-wrapper #input_tool_helper::-webkit-scrollbar {
    height: 4px;
}
.v-voice-wrapper #input_tool_helper::-webkit-scrollbar-thumb {
    background: #51A2D9;
    border-radius: 10px;
}

/* --- 8. 2026 Platform Specific Enhancements --- */

/* Windows 11 Styling: Rounded corners and Mica-like effect */
#win11 .v-voice-wrapper .boxed {
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(81, 162, 217, 0.5);
}

/* Mac Specific: Adjust typography for better rendering */
#mac .v-voice-wrapper {
    -webkit-font-smoothing: antialiased;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
}

/* Linux: Slightly thicker borders for high-contrast visibility */
#linux .v-voice-wrapper .btncustom {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile: Optimization for touch targets */
#mobile .v-voice-wrapper .btncustom,
#android .v-voice-wrapper .btncustom,
#ios .v-voice-wrapper .btncustom {
    min-height: 48px; /* Standard touch target size */
    touch-action: manipulation;
}

/* Desktop-only: Show custom scrollbar for Suggestion Helper */
#win .v-voice-wrapper #input_tool_helper::-webkit-scrollbar,
#win11 .v-voice-wrapper #input_tool_helper::-webkit-scrollbar,
#linux .v-voice-wrapper #input_tool_helper::-webkit-scrollbar {
    display: block;
}

/* Mobile-only: Hide scrollbar but keep functionality */
#mobile .v-voice-wrapper #input_tool_helper::-webkit-scrollbar {
    display: none;
}

@media screen and (max-width: 480px) {
    .v-voice-wrapper .grid-container1 {
        /* Changes from 6 columns to 3 columns (2 rows) */
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
        padding: 5px;
    }
}

.lang-selector-container { position: relative; width: 100%; max-width: 250px; margin-bottom: 10px; }

.custom-select-wrapper { position: relative; user-select: none; cursor: pointer; }

.custom-select-trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 15px; background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(81, 162, 217, 0.4); border-radius: 8px;
    font-size: 14px; color: #2a6592; transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.custom-select-trigger:hover { border-color: #51A2D9; background: #fff; }

.custom-options {
    position: absolute; display: block; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #51A2D9; border-top: 0;
    border-radius: 0 0 8px 8px; visibility: hidden; opacity: 0;
    transform: translateY(-10px); transition: all 0.3s ease; z-index: 100;
}

.custom-select-wrapper.open .custom-options { visibility: visible; opacity: 1; transform: translateY(0); }

.custom-option {
    position: relative; display: block; padding: 10px 15px;
    font-size: 14px; color: #2a6592; transition: all 0.2s ease;
}

.custom-option:hover { background: #B9E5F3; }

.custom-option.selected { background: #B9E5F3; font-weight: bold; }

.flag-icon { margin-right: 8px; font-size: 16px; }

.arrow {
    width: 0; height: 0; border-left: 5px solid transparent;
    border-right: 5px solid transparent; border-top: 5px solid #2a6592;
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .arrow { transform: rotate(180deg); }

