/* public.css - Fixed */
:root {
    --ndt-accent: #4F8CF7;
    --ndt-header-start: #D7EFE6;
    --ndt-header-mid1: #F1E6D7;
    --ndt-header-mid2: #F7D1C6;
    --ndt-header-mid3: #F4B1BA;
    --ndt-header-end: #EE9AA9;
    --ndt-text-color: #000000;
}

.ndt-app-container {
    max-width: 1240px;
    margin: 2rem auto;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: #1a202c;
    background: #f7fafc;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}
.ndt-app-header {
    background: linear-gradient(135deg, var(--ndt-header-start) 0%, var(--ndt-header-mid1) 30%, var(--ndt-header-mid2) 55%, var(--ndt-header-mid3) 80%, var(--ndt-header-end) 100%);
    padding: 3rem 2.5rem 2.5rem;
    color: #1a202c;
}
.ndt-header-main h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    color: #1a202c;
}
.ndt-header-main p {
    opacity: 0.8;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #2d3748;
}
.ndt-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
#ndt-main-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.4rem;
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: 0.2s;
}
#ndt-main-input:focus {
    outline: 2px solid var(--ndt-accent);
}
.ndt-preview-box {
    background: rgba(255,255,255,0.7);
    padding: 1.5rem;
    border-radius: 16px;
    min-height: 4rem;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    border: 1px dashed rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
}
.ndt-settings-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 1.5rem;
}
.ndt-setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.ndt-toggle-group {
    display: flex;
    background: rgba(255,255,255,0.5);
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}
.ndt-toggle-group button {
    padding: 0.4rem 1.2rem;
    border: none;
    background: transparent;
    color: #2d3748;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.ndt-toggle-group button.active {
    background: #fff;
    color: #1a202c;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.ndt-color-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
#ndt-color-picker {
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
}
.ndt-color-presets {
    display: flex;
    gap: 0.4rem;
}
.ndt-color-presets span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    transition: 0.2s;
}
.ndt-color-presets span:hover {
    transform: scale(1.15);
}
.ndt-main-layout {
    display: flex;
    background: #f7fafc;
}
.ndt-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
    max-height: 800px;
    overflow-y: auto;
}
[dir="rtl"] .ndt-sidebar {
    border-right: none;
    border-left: 1px solid #e2e8f0;
}
.ndt-sidebar-header {
    padding: 1.5rem 1rem;
}
#ndt-category-search {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f7fafc;
}
.ndt-category-menu {
    padding: 0.5rem;
}
.ndt-cat-tab {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
    transition: 0.2s;
    text-align: left;
}
[dir="rtl"] .ndt-cat-tab {
    text-align: right;
}
.ndt-cat-tab:hover {
    background: #edf2f7;
}
.ndt-cat-tab.active {
    background: #edf2f7;
    color: #1a202c;
    font-weight: 600;
}
.ndt-content {
    flex: 1;
    padding: 2rem;
}
.ndt-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
.ndt-result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    transition: 0.25s;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.ndt-result-card:hover {
    border-color: var(--ndt-accent);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-3px);
}
.ndt-result-text {
    font-size: 1.4rem;
    text-align: center;
    word-break: break-word;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ndt-result-text span {
    color: #000 !important;
}
.ndt-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.ndt-copy-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--ndt-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.ndt-copy-btn:hover {
    background: #3b6ec9;
}
.ndt-copy-btn.copied {
    background: #38a169 !important;
}
.ndt-fav-btn {
    width: 40px;
    height: 40px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.ndt-fav-btn:hover {
    background: #edf2f7;
}
.ndt-load-more {
    display: block;
    margin: 2rem auto;
    padding: 0.8rem 2.5rem;
    background: var(--ndt-accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}
.ndt-load-more:hover {
    background: #3b6ec9;
}
.ndt-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.hidden {
    display: none !important;
}
.ndt-text-muted {
    color: #718096;
    text-align: center;
    margin: 1rem 0;
}
.ndt-empty-state {
    text-align: center;
    color: #718096;
    padding: 2rem;
}
.ndt-miniaturized .ndt-result-card {
    padding: 1rem;
}
.ndt-miniaturized .ndt-result-text {
    font-size: 1.1rem;
}
.ndt-fade-in {
    animation: ndtFadeIn 0.3s ease forwards;
}
@keyframes ndtFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.ndt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.ndt-modal-overlay.active {
    display: flex;
}
.ndt-modal-box {
    background: #fff;
    max-width: 640px;
    width: 95%;
    border-radius: 24px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ndt-modal-box h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 1rem;
}
.ndt-close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #718096;
}
.ndt-modal-preview {
    font-size: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    text-align: center;
    min-height: 4rem;
    word-break: break-word;
    margin-bottom: 1.5rem;
    color: #000 !important;
}
.ndt-modal-controls label {
    display: block;
    font-weight: 600;
    margin: 1rem 0 0.3rem;
}
.ndt-color-control {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
#ndt-modal-color-picker {
    width: 48px;
    height: 48px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
}
#ndt-modal-color-hex {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: monospace;
}
.ndt-color-preview-box {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}
.ndt-modal-text-area-wrapper {
    position: relative;
}
#ndt-modal-text-input {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    color: #000;
}
#ndt-modal-text-input:focus {
    border-color: var(--ndt-accent);
    outline: none;
}
.ndt-on-screen-keyboard {
    margin-top: 0.8rem;
    background: #f1f4f9;
    padding: 0.5rem;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
.ndt-keyboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    justify-content: center;
}
.ndt-key {
    padding: 0.4rem 0.8rem;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    min-width: 30px;
    text-align: center;
    transition: 0.1s;
    color: #000 !important;
}
.ndt-key:hover {
    background: #e2e8f0;
}
.ndt-key:active {
    transform: scale(0.95);
}
.ndt-key.shift {
    background: #e2e8f0;
    font-weight: bold;
}
.ndt-key.space {
    min-width: 80px;
}
.ndt-key.backspace {
    min-width: 60px;
}
.ndt-emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0.5rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}
.ndt-emoji-grid span {
    font-size: 1.6rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    transition: 0.15s;
}
.ndt-emoji-grid span:hover {
    background: #e2e8f0;
    transform: scale(1.2);
}
.ndt-emoji-category {
    font-weight: 600;
    color: #4a5568;
    width: 100%;
    margin-top: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}
.ndt-emoji-category:first-of-type {
    margin-top: 0;
}
.ndt-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.ndt-modal-actions button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}
.ndt-copy-final {
    background: #2b6cb0;
    color: #fff;
}
.ndt-copy-final:hover {
    background: #1a4e7a;
}
.ndt-close-modal-btn {
    background: #edf2f7;
    color: #2d3748;
}
.ndt-close-modal-btn:hover {
    background: #e2e8f0;
}

/* Responsive */
@media (max-width: 1024px) {
    .ndt-main-layout {
        flex-direction: column;
    }
    .ndt-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 280px;
        overflow-y: auto;
    }
    [dir="rtl"] .ndt-sidebar {
        border-left: none;
    }
    .ndt-category-menu {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding: 0.5rem;
    }
    .ndt-cat-tab {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }
}
@media (max-width: 640px) {
    .ndt-app-header {
        padding: 1.5rem;
    }
    .ndt-header-main h1 {
        font-size: 1.6rem;
    }
    #ndt-main-input {
        font-size: 1.2rem;
        padding: 0.8rem 1rem;
    }
    .ndt-results-grid {
        grid-template-columns: 1fr;
    }
    .ndt-modal-box {
        padding: 1.5rem;
    }
    .ndt-modal-preview {
        font-size: 1.5rem;
    }
}