* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Source Code Pro', monospace;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e5e5e5;
    --text-secondary: #c7c7c7;
    --text-muted: #999999;
    --accent: #1786F9;
    --error: #ff6b6b;
    --success: #10b981;
    --warning: #f59e0b;
    --border: #4a4a4a;
    --border-light: #5a5a5a;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Columna Izquierda - Input */
.input-column {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
}

.editor-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.editor {
    width: 100%;
    height: 100%;
    padding: 10em 10% 5em 10%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.editor::placeholder {
    color: var(--text-muted);
}

/* Columna Central - Estadísticas */
.stats-column {
    width: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 1rem;
}

/* Logo */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0 1rem 0;
    margin-bottom: 1rem;
}

.logo-icon {
    margin-bottom: 0.5rem;
}

.logo-icon svg {
    width: 48px;
    height: 48px;
}

.logo-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Tabs Container */
.tabs-container {
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    width: 100%;
}

.tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tab:hover {
    color: var(--accent);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tab Content */
.tab-content {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* Limpiar Tab (actual) */
.delete-controls {
    padding: 1.5rem 0.8rem 0rem 0.8rem;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    padding: 0.5rem;
    background-color: var(--error);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover:not(:disabled) {
    background-color: #e55555;
}

.search-button:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0rem;
}

.stat-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-top: 1px var(--border) solid;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.75rem;
    justify-content: space-between;
}

.stat-item:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

.stat-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stat-item.disabled:last-child {
    border-bottom: 1px var(--border) solid;
}

.stat-item.disabled:hover {
    border-color: var(--border);
    background-color: var(--bg-tertiary);
}

.stat-count {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--error);
    min-width: 30px;
    text-align: center;
}

.stat-count.disabled {
    color: var(--text-muted);
}

.stat-info {
    flex: 1;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

.stat-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.stat-delete-icon {
    color: var(--text-secondary);
    font-size: 1rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.stat-item:hover .stat-delete-icon {
    opacity: 1;
    color: #ff6b6b;
}

.stat-item.disabled .stat-delete-icon {
    color: var(--text-muted);
}

/* Opción Limpiar todo */
.stat-item.clean-all {
    margin-bottom: 0rem;
}

/* Columna Derecha - Output */
.output-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
    position: relative;
}

.output-editor {
    width: 100%;
    height: 100%;
    padding: 10em 10% 5em 10%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
}

.output-editor::placeholder {
    color: var(--text-muted);
}

/* Placeholder para otras tabs */
.tab-placeholder {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Scrollbars personalizados */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-column {
        width: 350px;
    }
    
    .editor, .output-editor {
        padding: 1rem;
    }

    .tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
}

/* Radio Button Group with Button Style */
.radio-button-group {
    display: flex;
    gap: 0;
    margin: 1rem 0 0.5rem 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    width: fit-content;
}

.radio-button-group input[type="radio"] {
    display: none;
}

.radio-button {
    padding: 0.5rem 1rem;
    background-color: #2d2d2d;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    border-right: 1px solid var(--border);
    transition: all 0.2s ease;
    user-select: none;
}

.radio-button:last-child {
    border-right: none;
}

.radio-button:hover {
    background-color: #4b5563;
}

.radio-button-group input[type="radio"]:checked + .radio-button {
    background-color: #007aff;
    color: white;
}

.radio-button-group input[type="radio"]:disabled + .radio-button {
    background-color:#1a1a1a;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.radio-button-group input[type="radio"]:disabled + .radio-button:hover {
}

.position-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Estadísticas específicas para la pestaña Añadir */
#addStatsList .stat-item:hover {
    background-color: rgba(97, 200, 132, 0.1);
}

#addStatsList .stat-item.disabled:hover {
    background-color: var(--bg-tertiary);
}

#addStatsList .stat-item.disabled:hover .stat-delete-icon {
    color: var(--text-muted);
}

#addStatsList .stat-count {
    color: #61C884;
}

#addStatsList .stat-count.disabled {
    color: var(--text-muted);
}

#addStatsList .stat-item:hover .stat-delete-icon {
    color: #61C884;
}

/* Botón + verde en la pestaña Añadir */
#add-tab .search-button {
    background-color: #61C884;
}

#add-tab .search-button:hover:not(:disabled) {
    background-color: #4ead73;
}

#add-tab .search-button:disabled {
    background-color: var(--text-muted);
}

/* Botón azul en la pestaña Reemplazar */
#replace-tab .search-button {
    background-color: var(--accent);
}

#replace-tab .search-button:hover:not(:disabled) {
    background-color: #1470d6;
}

#replace-tab .search-button:disabled {
    background-color: var(--text-muted);
}

/* Textarea de ancho completo en la pestaña Reemplazar */
#replace-tab .search-input {
    width: 100%;
    box-sizing: border-box;
}

/* Botón de ancho completo en la pestaña Reemplazar */
#replace-tab .search-container {
    display: block;
}

#replace-tab .search-button {
    width: 100%;
    min-width: unset;
    gap: 0.5rem;
    padding: 0.75rem;
}

/* Estilos específicos para la pestaña Transformar */
#transformList .stat-item .stat-name {
    color: var(--text-secondary);
}
#transformList .stat-item .stat-name:hover {
    color: var(--accent);
}

#transformList .stat-item .stat-delete-icon {
    color: var(--text-secondary);
}

#transformList .stat-item:hover {
    background-color: rgba(23, 134, 249, 0.2);
}

#transformList .stat-item:hover .stat-delete-icon {
    color: var(--accent);
}

#transformList .stat-item.disabled:hover {
    background-color: var(--bg-tertiary);
}

#transformList .stat-item.disabled:hover .stat-delete-icon {
    color: var(--text-muted);
}

#transformList .stat-item:last-child {
    border-bottom: 1px solid var(--border) !important;
    margin-bottom: 1rem;
}

/* Floating Toolbar */
.floating-toolbar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.floating-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.floating-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.floating-btn:active {
    transform: translateY(0);
}

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

.floating-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Botón de apoyo en esquina superior derecha */
.top-right-support-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background-color: #3a3a3a;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.top-right-support-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

.top-right-support-btn:hover  svg{
    stroke: white;
    transform: translateY(-2px);
}

.top-right-support-btn:active {
    transform: translateY(0);
}

.top-right-support-btn svg {
    stroke: #ff6b6b;
}

/* Tooltips para botones flotantes */
.floating-btn[title] {
    position: relative;
}

.floating-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.floating-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 42px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--bg-primary);
    z-index: 1002;
    pointer-events: none;
}

/* Support Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.support-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: var(--bg-primary);
    border-left: 1px solid var(--border);
    z-index: 1999;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.support-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-drawer {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-drawer:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.drawer-content {
    padding: 1.5rem;
}

.support-section {
    margin-bottom: 2rem;
}

.support-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.support-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.support-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.support-link {
    display: block;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.support-link:hover {
    background-color: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.support-link strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.support-link span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.support-section ul {
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1.5rem;
}

.support-section li {
    margin-bottom: 0.5rem;
}

.contact-info {
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.contact-info strong {
    color: var(--text-primary);
}

/* Drawer */
.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.drawer.open {
    visibility: visible;
    opacity: 1;
}

/* AdSense Banners */
.ad-banner {
    width: 100%;
    margin: 20px 0;
    text-align: center;
    min-height: 90px;
    display: block;
}

.ad-banner-top {
    margin-bottom: 30px;
}

.ad-banner-bottom {
    margin-top: 30px;
}

/* AdSense responsive ads */
.adsbygoogle {
    display: block !important;
    width: 100% !important;
    max-width: 728px !important;
    margin: 0 auto !important;
}

.ad-placeholder {
    width: 728px;
    height: 90px;
    max-width: 100%;
    margin: 0 auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.ad-content {
    text-align: center;
}

.ad-label {
    display: block;
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ad-space {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    flex: 1;
}

.cookie-accept-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.cookie-accept-btn:hover {
    background: #0056b3;
}

.cookie-banner.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-column {
        width: 350px;
    }
    
    .editor, .output-editor {
        padding: 1rem;
    }

    .tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    
    .drawer-content {
        width: 100%;
    }
    
    .toolbar {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .toolbar-btn {
        width: 40px;
        height: 40px;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-content p {
        font-size: 0.85rem;
    }
    
    .cookie-accept-btn {
         width: 100%;
         max-width: 200px;
     }
     
     /* Banners responsivos */
     .ad-placeholder {
         width: 320px;
         height: 50px;
     }
     
     .ad-content {
         font-size: 0.75rem;
     }
     
     .ad-label {
         font-size: 0.65rem;
     }
     
     .ad-space {
         font-size: 0.75rem;
     }
 }