/* ============================================================
   Universal Indian Font Converter — Fully Updated Frontend Styles
   ============================================================ */

/* ── 1. CSS Variables & Reset ────────────────────────────── */
:root {
    --uifc-blue:         #1a6fc4;
    --uifc-blue-light:   #e8f2fb;
    --uifc-blue-dark:    #104e8b;
    --uifc-purple:       #6d28d9;
    --uifc-purple-light: #f0ebff;
    --uifc-purple-dark:  #4c1d95;
    --uifc-green:        #16a34a;
    --uifc-green-dark:   #15803d;
    --uifc-red:          #dc2626;
    --uifc-red-dark:     #b91c1c;
    --uifc-orange:       #ea580c;
    --uifc-text:         #1e293b;
    --uifc-muted:        #64748b;
    --uifc-border:       #e2e8f0;
    --uifc-bg:           #f8fafc;
    --uifc-white:        #ffffff;
    --uifc-radius:       10px;
    --uifc-trans:        0.2s ease-in-out;
    --uifc-shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --uifc-shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
    --uifc-shadow-lg:    0 10px 30px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.06);
}

.uifc-wrapper-modern *, .uifc-wrapper-modern *::before, .uifc-wrapper-modern *::after {
    box-sizing: border-box;
}

/* ── 2. Wrapper & Header ─────────────────────────────────── */
.uifc-wrapper-modern {
    max-width: 1020px;
    margin: 30px auto;
    padding: 0;
    background: var(--uifc-bg);
    border-radius: 16px;
    box-shadow: var(--uifc-shadow-lg);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--uifc-text);
    overflow: hidden;
}

.uifc-header {
    background: linear-gradient(135deg, var(--uifc-blue) 0%, var(--uifc-purple) 100%);
    padding: 22px 30px;
    text-align: center;
    position: relative;
}

.uifc-header h2 {
    color: #ffffff !important;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .3px;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
    border-color: #ffffff !important; 
}

/* Theme Override: Force header vertical lines/pseudo-elements to white */
.uifc-header::before,
.uifc-header h2::before,
.uifc-header h2::after,
.uifc-header span[style*="border"] {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}

/* ── 3. Font Selectors ───────────────────────────────────── */
#uifc-top-font-wrap {
    background: var(--uifc-white);
    border-bottom: 2px solid var(--uifc-border);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

#uifc-top-font-wrap label {
    font-size: 13px;
    font-weight: 700;
    color: var(--uifc-blue-dark);
    text-transform: uppercase;
    letter-spacing: .6px;
    white-space: nowrap;
}

.uifc-modern-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--uifc-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%231a6fc4' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 18px;
    border: 2px solid var(--uifc-border);
    border-radius: 8px;
    padding: 9px 40px 9px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--uifc-text);
    cursor: pointer;
    transition: all var(--uifc-trans);
    min-width: 220px;
}

.uifc-modern-select:hover { border-color: var(--uifc-blue); }
.uifc-modern-select:focus {
    outline: none;
    border-color: var(--uifc-blue);
    box-shadow: 0 0 0 3px rgba(26,111,196,.18);
}

#uifc-top-font-wrap .uifc-modern-select {
    flex: 1;
    max-width: 480px;
    font-size: 15px;
    padding: 10px 44px 10px 16px;
    border-radius: 10px;
    border-color: var(--uifc-blue);
    box-shadow: var(--uifc-shadow-sm);
}
#uifc-top-font-wrap .uifc-modern-select:focus {
    box-shadow: 0 0 0 4px rgba(26,111,196,.2);
}

/* ── 4. Text Converter Section (Blue Accent) ─────────────── */
.uifc-text-converter-section {
    padding: 36px 28px 20px; /* Top padding increased for label spacing */
    border-left: 5px solid var(--uifc-blue);
    background: linear-gradient(to right, var(--uifc-blue-light) 0%, var(--uifc-white) 55%);
    border-bottom: 1px dashed #b6d4f5;
    position: relative;
}

/* Centered Label */
.uifc-text-converter-section::before {
    content: "✦ Text Converter";
    position: absolute;
    top: 12px; 
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--uifc-blue); opacity: .65;
}

.uifc-editor-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

/* ── 5. Bulk File Converter Section (Purple Accent) ──────── */
.uifc-file-upload-modern {
    margin: 0;
    padding: 36px 28px 28px; /* Top padding increased for label spacing */
    border-left: 5px solid var(--uifc-purple);
    background: linear-gradient(to right, var(--uifc-purple-light) 0%, var(--uifc-white) 60%);
    border-top: 1px dashed #c4b5fd;
    position: relative;
    text-align: center;
}

/* Centered Label */
.uifc-file-upload-modern::before {
    content: "⬆ Bulk File Converter";
    position: absolute;
    top: 12px; 
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--uifc-purple); opacity: .65;
}

.uifc-file-upload-modern h3 {
    margin: 0 0 6px;
    font-size: 16px; font-weight: 700;
    color: var(--uifc-purple-dark);
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
}

.uifc-file-upload-modern > p {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--uifc-muted);
}

/* BULK FONT SELECTOR - CENTER ALIGNMENT */
.uifc-bulk-font-selector {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0 auto 20px auto; 
    width: 100%;
    max-width: 320px; 
}

.uifc-bulk-font-selector label {
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .7px;
    color: var(--uifc-purple-dark); white-space: nowrap;
}

.uifc-bulk-font-selector .uifc-modern-select {
    width: 100%;
    border-color: var(--uifc-purple);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%236d28d9' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}
.uifc-bulk-font-selector .uifc-modern-select:hover  { border-color: var(--uifc-purple-dark); }
.uifc-bulk-font-selector .uifc-modern-select:focus  {
    border-color: var(--uifc-purple-dark);
    box-shadow: 0 0 0 3px rgba(109,40,217,.18);
}

/* RADIO BUTTONS - SINGLE ROW */
.uifc-file-direction {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: nowrap; 
    gap: 16px;
    width: 100%;
}

.file-radio {
    flex: 1 1 0;
    min-width: auto;
    max-width: 280px;
    cursor: pointer;
}
.file-radio input[type="radio"] { display: none; }

.file-radio .radio-card {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px;
    background: var(--uifc-white);
    border: 2px solid var(--uifc-border);
    border-radius: 10px;
    transition: all var(--uifc-trans);
    user-select: none; text-align: left;
    height: 100%;
}
.file-radio .radio-card::before {
    content: ""; flex-shrink: 0;
    width: 18px; height: 18px;
    border: 2px solid #94a3b8; border-radius: 50%;
    background: var(--uifc-white); transition: all var(--uifc-trans);
}
.file-radio .radio-card .rc-label { display: flex; flex-direction: column; }
.file-radio .radio-card .rc-title { font-size: 14px; font-weight: 700; color: var(--uifc-text); line-height: 1.3; }
.file-radio .radio-card .rc-hint  { font-size: 11px; color: var(--uifc-muted); margin-top: 2px; }
.file-radio .radio-card .rc-icon  { font-size: 22px; line-height: 1; margin-right: 2px; }

.file-radio input[type="radio"]:checked + .radio-card {
    border-color: var(--uifc-purple);
    background: var(--uifc-purple-light);
    box-shadow: 0 0 0 3px rgba(109,40,217,.12);
}
.file-radio input[type="radio"]:checked + .radio-card::before {
    border-color: var(--uifc-purple);
    background: var(--uifc-purple);
    box-shadow: inset 0 0 0 3px var(--uifc-white);
}
.file-radio input[type="radio"]:checked + .radio-card .rc-title { color: var(--uifc-purple-dark); }
.file-radio input[type="radio"]:not(:checked) + .radio-card:hover {
    border-color: #a78bfa; box-shadow: var(--uifc-shadow-sm);
}

.uifc-synced-select.syncing { animation: uifc-sync-pulse .35s ease; }
@keyframes uifc-sync-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(26,111,196,.45); }
    70%  { box-shadow: 0 0 0 8px rgba(26,111,196,0); }
    100% { box-shadow: 0 0 0 0 rgba(26,111,196,0);   }
}

/* ── 6. Textarea Cards ───────────────────────────────────── */
.uifc-card {
    background: var(--uifc-white);
    border: 1.5px solid var(--uifc-border);
    border-top: 3px solid var(--uifc-blue);
    border-radius: var(--uifc-radius);
    box-shadow: var(--uifc-shadow-sm);
    overflow: hidden; display: flex;
    flex-direction: column;
    transition: box-shadow var(--uifc-trans);
}
.uifc-card:hover { box-shadow: var(--uifc-shadow-md); }
.uifc-card:nth-child(2) { border-top-color: var(--uifc-orange); }

.uifc-card-header {
    background: linear-gradient(90deg, #f1f8ff 0%, var(--uifc-bg) 100%);
    padding: 11px 15px;
    font-size: 13px; font-weight: 700;
    color: var(--uifc-blue-dark);
    border-bottom: 1px solid var(--uifc-border);
    display: flex; align-items: center; gap: 7px;
}
.uifc-card:nth-child(2) .uifc-card-header {
    background: linear-gradient(90deg, #fff8f5 0%, var(--uifc-bg) 100%);
    color: var(--uifc-orange);
}

/* Dynamic legacy header text */
#uifc-legacy-header-text {
    font-weight: 600;
    margin-left: 8px;
    color: var(--uifc-orange);
}

.uifc-card textarea {
    width: 100%; height: 240px;
    padding: 14px 16px; border: none;
    resize: vertical; font-size: 16px; line-height: 1.7;
    color: var(--uifc-text); background: #fdfdfd;
    transition: background var(--uifc-trans);
}
.uifc-card textarea:focus { outline: none; background: var(--uifc-white); }

/* ── 7. Buttons ──────────────────────────────────────────── */
.uifc-button-group {
    padding: 10px 12px; background: var(--uifc-bg);
    display: flex; flex-wrap: wrap; gap: 8px;
    border-top: 1px solid var(--uifc-border);
}

.uifc-button-group button, .btn-convert, .btn-copy, .btn-clear {
    padding: 7px 14px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all var(--uifc-trans); letter-spacing: .2px;
}
.uifc-button-group button:active, #uifc-upload-btn:active { transform: scale(.96); }

.btn-convert {
    background: linear-gradient(135deg, var(--uifc-blue) 0%, #2563eb 100%);
    color: #fff; box-shadow: 0 2px 6px rgba(26,111,196,.35);
}
.btn-convert:hover {
    background: linear-gradient(135deg, var(--uifc-blue-dark) 0%, #1d4ed8 100%);
    box-shadow: 0 3px 10px rgba(26,111,196,.45);
}
.btn-copy {
    background: linear-gradient(135deg, var(--uifc-green) 0%, var(--uifc-green-dark) 100%);
    color: #fff; box-shadow: 0 2px 6px rgba(22,163,74,.3);
}
.btn-copy:hover { background: linear-gradient(135deg, var(--uifc-green-dark) 0%, #14532d 100%); }
.btn-clear {
    background: linear-gradient(135deg, var(--uifc-red) 0%, var(--uifc-red-dark) 100%);
    color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.3);
}
.btn-clear:hover { background: linear-gradient(135deg, var(--uifc-red-dark) 0%, #991b1b 100%); }

#uifc-upload-btn {
    background: linear-gradient(135deg, var(--uifc-purple) 0%, #7c3aed 100%);
    color: #fff; padding: 10px 22px; font-size: 14px; font-weight: 700;
    border: none; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    box-shadow: 0 3px 10px rgba(109,40,217,.35);
    transition: all var(--uifc-trans);
}
#uifc-upload-btn:hover {
    background: linear-gradient(135deg, var(--uifc-purple-dark) 0%, #5b21b6 100%);
    box-shadow: 0 5px 16px rgba(109,40,217,.4);
}
#uifc-upload-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── 8. File Input ───────────────────────────────────────── */
.uifc-file-controls {
    margin-top: 24px;
    display: flex; align-items: center;
    justify-content: center; gap: 12px; flex-wrap: wrap;
}
#uifc-file-input {
    flex: 1; min-width: 180px; max-width: 400px;
    padding: 9px 12px;
    border: 2px dashed var(--uifc-purple); border-radius: 8px;
    font-size: 13px; color: var(--uifc-muted);
    background: var(--uifc-white); cursor: pointer;
    transition: all var(--uifc-trans);
}
#uifc-file-input:hover, #uifc-file-input:focus {
    outline: none; border-color: var(--uifc-purple-dark);
    background: var(--uifc-purple-light);
}

/* ── 9. Loader & Download ───────────────────────────────── */
#uifc-loader {
    margin-top: 16px; text-align: center;
    font-size: 14px; color: var(--uifc-purple-dark); font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

.uifc-download-btn, #uifc-download-link a {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 16px; padding: 11px 24px;
    background: linear-gradient(135deg, var(--uifc-green) 0%, var(--uifc-green-dark) 100%);
    color: #fff; font-size: 14px; font-weight: 700;
    border: none; border-radius: 8px; text-decoration: none; cursor: pointer;
    box-shadow: 0 3px 12px rgba(22,163,74,.35);
    transition: all var(--uifc-trans);
    animation: uifc-pop-in .3s cubic-bezier(.175,.885,.32,1.275);
}
.uifc-download-btn:hover, #uifc-download-link a:hover {
    background: linear-gradient(135deg, var(--uifc-green-dark) 0%, #14532d 100%);
    box-shadow: 0 5px 16px rgba(22,163,74,.45);
    transform: translateY(-1px);
}

@keyframes uifc-pop-in {
    from { opacity: 0; transform: scale(.85) translateY(8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}
.uifc-spin { display: inline-block; animation: uifc-spin 1s linear infinite; }
@keyframes uifc-spin { to { transform: rotate(360deg); } }

/* ── 10. Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .uifc-editor-modern { grid-template-columns: 1fr; }
    #uifc-top-font-wrap { flex-direction: column; align-items: stretch; }
    #uifc-top-font-wrap .uifc-modern-select { max-width: 100%; }
}

@media (max-width: 576px) {
    .uifc-text-converter-section { padding: 20px 10px 16px; }
    .uifc-button-group { flex-wrap: nowrap !important; gap: 5px; padding: 8px 6px; }
    .uifc-button-group button, .btn-convert, .btn-copy, .btn-clear {
        flex: 1; justify-content: center; padding: 7px 5px;
        font-size: 11px; white-space: nowrap;
    }
    .uifc-bulk-font-selector { max-width: 100%; }
    .uifc-file-direction { flex-direction: column; align-items: stretch; }
    .file-radio { max-width: 100%; }
    .uifc-file-controls { flex-direction: column; align-items: stretch; margin-top: 16px; }
    #uifc-file-input { max-width: 100%; }
    #uifc-upload-btn { width: 100%; justify-content: center; }
    
    /* मोबाइल व्यू में जगह बचाने के लिए इन लेबल्स को छिपा दिया गया है */
    .uifc-text-converter-section::before, .uifc-file-upload-modern::before { display: none; }
    
    .uifc-header { padding: 16px 20px; }
}
