/* ══ PREMIUM UNICODE CONVERTER STYLES — PORTAL THEME ══ */

@font-face {
    font-family: 'Preeti';
    src: url('../fonts/PREETI.TTF') format('truetype');
    font-display: swap;
}

/* ── Outer wrapper ── */
.uni-wrap {
    max-width: 1200px;
    margin: 20px auto 40px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    font-family: 'Mukta', sans-serif;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* ── Top brand header ── */
.uni-top-band {
    background: linear-gradient(135deg, #8c1829 0%, #6a121f 100%);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 4px solid #f57c00;
}

.uni-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uni-brand-title {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.uni-brand-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 400;
}

.uni-download-btn {
    background: #ffffff;
    color: #8c1829 !important;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.uni-download-btn:hover {
    background: #f57c00;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 124, 0, 0.4);
    text-decoration: none;
}

/* ── Tab bar ── */
.uni-tabbar {
    background: #f3f4f6;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.uni-tab-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.uni-grid-toggle {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    outline: none;
}

.uni-grid-toggle:hover {
    background: rgba(140, 24, 41, 0.05);
    color: #8c1829;
    border-color: #8c1829;
}

.uni-grid-toggle.active {
    background: #8c1829;
    color: #ffffff;
    border-color: #8c1829;
    box-shadow: 0 4px 12px rgba(140, 24, 41, 0.25);
}

.uni-tab {
    background: transparent;
    color: #4b5563;
    border: none;
    padding: 12px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.uni-tab:hover {
    background: rgba(140, 24, 41, 0.05);
    color: #8c1829;
}

.uni-tab.active {
    background: #8c1829;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(140, 24, 41, 0.25);
}

/* ── Panel ── */
.uni-panel {
    display: none;
    padding: 24px;
    background: #ffffff;
    animation: fadeIn 0.3s ease;
}

.uni-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Layout Grid ── */
.uni-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 868px) {
    .uni-cols {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Textarea Cards ── */
.uni-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: all 0.3s ease;
}

.uni-card:focus-within {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* ── Header ── */
.uni-card-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 700;
    color: #374151;
    font-size: 0.95rem;
}

.uni-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uni-card-title i {
    color: #8c1829;
}

.uni-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Textarea ── */
.uni-textarea {
    width: 100%;
    height: 380px;
    min-height: 200px;
    padding: 18px;
    border: none;
    resize: vertical;
    font-size: 1.15rem;
    line-height: 1.8;
    background: #ffffff;
    color: #1f2937;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    transition: background-color 0.25s;
}

.uni-textarea::placeholder {
    color: #9ca3af;
}

.uni-output {
    background: #f9fafb;
}

/* Preeti font specific box */
.preeti-font-input {
    font-family: 'Preeti', sans-serif;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
}

/* ── Footer ── */
.uni-card-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    color: #6b7280;
}

.uni-counter {
    font-weight: 600;
}

/* ── Card Buttons ── */
.uni-btn-sm {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.uni-btn-sm:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

.uni-btn-primary-sm {
    background: #8c1829;
    color: #ffffff;
    border: 1px solid #8c1829;
}

.uni-btn-primary-sm:hover {
    background: #6a121f;
    color: #ffffff;
    border-color: #6a121f;
}

.uni-btn-success-sm {
    background: #10b981;
    color: #ffffff;
    border: 1px solid #10b981;
}

.uni-btn-success-sm:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}

/* ── Speech / Mic Button ── */
.uni-mic-btn {
    position: relative;
}

.uni-mic-btn.recording {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ── Font size controls ── */
.uni-size-controls {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}

.uni-size-btn {
    background: transparent;
    border: none;
    color: #4b5563;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    outline: none;
}

.uni-size-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.uni-size-btn:first-child {
    border-right: 1px solid #d1d5db;
}

/* ── Special characters bar (Arthasarokar Style) ── */
.uni-special-chars-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    font-size: 1.05rem;
    color: #1f2937;
    font-family: inherit;
    font-weight: 500;
}

.uni-special-label {
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 600;
    margin-right: 4px;
}

.uni-special-item {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 700;
    color: #1f2937;
}

.uni-special-item:hover {
    background: #e5e7eb;
    color: #000000;
}


/* ── Floating Toast Notification ── */
.unicode-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1f2937;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.unicode-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.unicode-toast .toast-icon {
    width: 28px;
    height: 28px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #ffffff;
    flex-shrink: 0;
}

/* ── Custom Scrollbar for Textareas ── */
.uni-textarea::-webkit-scrollbar {
    width: 8px;
}

.uni-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.uni-textarea::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.uni-textarea::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ── Responsive Styling ── */
@media (max-width: 768px) {
    .uni-wrap {
        margin: 10px 0 20px;
        border-radius: 12px;
    }

    .uni-top-band {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .uni-brand-title {
        font-size: 1.4rem;
    }

    .uni-download-btn {
        width: 100%;
        justify-content: center;
    }

    .uni-tabbar {
        padding: 4px;
    }

    .uni-tab {
        padding: 10px 14px;
        font-size: 0.82rem;
        flex: 1 1 auto;
        justify-content: center;
    }

    .uni-panel {
        padding: 15px;
    }

    .uni-textarea {
        /* Set smaller height on mobile so both boxes are visible at the same time */
        height: 200px;
        font-size: 1.05rem;
        padding: 12px;
    }

    .preeti-font-input {
        font-size: 1.25rem;
    }

    .uni-card-header {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .uni-card-footer {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .uni-btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .unicode-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        padding: 12px 18px;
        font-size: 0.88rem;
    }
}

/* ── Stacked Layout & Typeshala Styles ── */
.uni-cols.stacked-layout {
    grid-template-columns: 1fr !important;
}

.uni-cols.stacked-layout .uni-textarea {
    height: 250px;
}

.typeshala-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
}

.typeshala-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.typeshala-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 200px;
}

.typeshala-control-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4b5563;
}

.typeshala-control-group select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1f2937;
    background: #ffffff;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}

.typeshala-control-group select:focus {
    border-color: #8c1829;
}

.typeshala-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.typeshala-stat-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.typeshala-stat-item .stat-label {
    display: block;
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.typeshala-stat-item .stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #8c1829;
}

.typeshala-practice-area {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.typeshala-text-display-container {
    background: #f9fafb;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    min-height: 100px;
    display: flex;
    align-items: center;
}

.typeshala-text-display {
    font-size: 1.6rem;
    line-height: 2.2;
    color: #4b5563;
    white-space: pre-wrap;
    word-break: break-all;
    width: 100%;
    user-select: none;
}

.typeshala-text-display span {
    padding: 2px 2px;
    margin: 0 1px;
    border-radius: 3px;
    display: inline-block;
}

.typeshala-text-display span.correct {
    background-color: #d1fae5;
    color: #065f46;
}

.typeshala-text-display span.incorrect {
    background-color: #fee2e2;
    color: #991b1b;
}

.typeshala-text-display span.current {
    background-color: #dbeafe;
    color: #1e40af;
    border-bottom: 2px solid #2563eb;
    animation: blink-caret 1.0s infinite alternate;
}

@keyframes blink-caret {
    from {
        border-bottom-color: transparent
    }

    to {
        border-bottom-color: #2563eb
    }
}

.typeshala-input-container {
    padding: 0;
    position: relative;
}

.typeshala-input {
    width: 100%;
    height: 120px;
    padding: 18px;
    border: none;
    resize: none;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.typeshala-input::placeholder {
    color: #9ca3af;
}

.typeshala-action-bar {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.typeshala-help-text {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* Preeti Font adjustments for Typeshala */
.typeshala-text-display.preeti-font span,
.typeshala-input.preeti-font {
    font-family: 'Preeti', sans-serif !important;
}

.typeshala-text-display.preeti-font span {
    font-size: 2.2rem !important;
    line-height: 1.2;
}

.typeshala-input.preeti-font {
    font-size: 1.8rem !important;
}

@media (max-width: 640px) {
    .typeshala-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .typeshala-stat-item .stat-value {
        font-size: 1.15rem;
    }

    .typeshala-text-display {
        font-size: 1.3rem;
    }

    .typeshala-text-display.preeti-font span {
        font-size: 1.6rem !important;
    }
}