/* Enhanced Text Cleaner Tool - Complete CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
    
    /* CSS Variables */
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --primary-pink: #ec4899;
    --success-green: #10b981;
    --warning-amber: #f59e0b;
    --error-red: #ef4444;
    --light-gray: #f8fafc;
    --border-gray: #d1d5db;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
}

.mt-tcl-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.mt-tcl-tool-container {
    background: #ffffff;
    border: 3px solid var(--border-gray);
    border-radius: 20px;
    padding: 2rem;
    transition: border 0.3s ease;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.mt-tcl-tool-container:hover {
    border: 3px solid transparent;
    background: linear-gradient(#ffffff, #ffffff) padding-box,
                linear-gradient(90deg, var(--primary-blue), var(--primary-purple), var(--primary-pink)) border-box;
}

.gradient-text {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-family: 'Inter', sans-serif;
}

.mt-tcl-text-input-container {
    background: var(--light-gray);
    border: 2px solid var(--border-gray);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.mt-tcl-text-area {
    width: 100%;
    min-height: 16rem;
    max-height: 22rem;
    background: transparent;
    
    /* Yahan tabdeeli karein */
    border: 2px solid var(--border-gray); /* 'border: none;' ko is line se badal dein */
    border-radius: 12px; /* Golائی ke liye (optional, apni marzi se adjust karein) */
    padding: 1rem; /* Text aur border ke beech thori space ke liye (optional) */

    outline: none;
    overflow-y: auto;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    position: relative;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.mt-tcl-text-area:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    pointer-events: none;
}

.mt-tcl-text-area:focus:empty::before {
    content: '';
}

/* Rich text styling for contenteditable */
.mt-tcl-text-area h1 {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: #1e40af;
}

.mt-tcl-text-area h2 {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0.4rem 0;
    color: #1e40af;
}

.mt-tcl-text-area h3 {
    font-size: 1.15rem;
    font-weight: bold;
    margin: 0.3rem 0;
    color: #1e40af;
}

.mt-tcl-text-area h4, .mt-tcl-text-area h5, .mt-tcl-text-area h6 {
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0.25rem 0;
    color: #1e40af;
}

.mt-tcl-text-area p {
    margin: 0.5rem 0;
}

.mt-tcl-text-area strong, .mt-tcl-text-area b {
    font-weight: bold;
}

.mt-tcl-text-area em, .mt-tcl-text-area i {
    font-style: italic;
}

.mt-tcl-text-area u {
    text-decoration: underline;
}

.mt-tcl-text-area a {
    color: #3b82f6;
    text-decoration: underline;
}

.mt-tcl-text-area ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.mt-tcl-text-area ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.mt-tcl-text-area li {
    margin: 0.25rem 0;
}

.mt-tcl-stats-counter {
    position: absolute;
    bottom: 0.1rem;
    right: 1.0rem;
    background: #4A90E2;
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    z-index: 10;
}

.mt-tcl-controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.mt-tcl-controls-left,
.mt-tcl-controls-right {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

 /* 1. This is your updated container style */
    .mt-tcl-toolbar-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        align-items: center;
    }

    /* 2. Add this NEW rule for the buttons inside the container */
    /* This tells each child element (your buttons) to grow equally */
    .mt-tcl-toolbar-row > * {
        flex: 1 1 auto; /* This is the key property to make them fill the space */
        text-align: center;
    }

.mt-tcl-btn {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    position: relative;
    justify-content: center;
}

.mt-tcl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.mt-tcl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.mt-tcl-btn-gradient { background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple)); color: white; }
.mt-tcl-btn-purple { background: var(--primary-purple); color: white; }
.mt-tcl-btn-green { background: var(--success-green); color: white; }
.mt-tcl-btn-pink { background: var(--primary-pink); color: white; }
.mt-tcl-btn-red { background: var(--error-red); color: white; }
.mt-tcl-btn-amber { background: var(--warning-amber); color: white; }
.mt-tcl-btn-blue { background: var(--primary-blue); color: white; }
.mt-tcl-btn-orange { background: #f97316; color: white; }

.mt-tcl-input-field {
    width: 100px;
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    border: 2px solid var(--border-gray);
    border-radius: 0.5rem;
    background: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.mt-tcl-input-field:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.mt-tcl-dropdown {
    position: relative; /* Sirf isko rehne dein */
    display: flex;      /* Isko add karein takay andar ka button theek se align ho */
    flex: 1;            /* Yeh bhi add kar dein behtari ke liye */
}

.mt-tcl-dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    z-index: 1000;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.25rem;
}

.mt-tcl-dropdown-content.export-dropdown {
    bottom: 100%;
    margin-bottom: 0.25rem;
}

.mt-tcl-dropdown-content.show {
    display: block;
}

.mt-tcl-dropdown-item {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.mt-tcl-dropdown-item:hover {
    background-color: var(--light-gray);
}
/* Add this new rule to make the button fill the dropdown wrapper */
.mt-tcl-dropdown .mt-tcl-btn {
    width: 100%;
    justify-content: center; /* This will center the button's text */
}

.mt-tcl-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-green);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.mt-tcl-toast.show {
    transform: translateX(0);
}

.mt-tcl-toast.error {
    background: var(--error-red);
}

.mt-tcl-toast.success {
    background: var(--success-green);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body { padding: 1rem; }
    .mt-tcl-tool-container { padding: 1rem; }
    .mt-tcl-controls-container { flex-direction: column; gap: 0.5rem; }
    .mt-tcl-controls-left, .mt-tcl-controls-right { justify-content: center; flex-wrap: wrap; }
    .mt-tcl-toolbar-row { justify-content: center; }
    .mt-tcl-btn { padding: 0.3rem 0.5rem; font-size: 0.65rem; gap: 0.1rem; }
    .mt-tcl-input-field { width: 80px; padding: 0.3rem 0.4rem; font-size: 0.65rem; }
    .gradient-text { font-size: 1.8rem; }
}

/* Highlighting style for find/replace functionality */
mark {
    background: linear-gradient(90deg, #f59e0b, #ec4899);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 500;
}