:root {
    /* Variables comunes */
    --danger: #dc143c;
    --success: #228b22;
    --warning: #ff8c00;
}

/* ===== GENERAL ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
    min-height: 100vh;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Controles superiores */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

/* Tabs */
.tab-container {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.tab-button.active {
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
}

/* Content */
.content-container {
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Domain Input Styles */
.domain-input-container {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.domain-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* Buttons */
button {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.whois-button, .add-button {
    white-space: nowrap;
}

.remove-button {
    background-color: transparent;
    font-size: 1.2rem;
    padding: 0.5rem;
    color: var(--danger);
}

.domain-input-row {
    margin-bottom: 0.75rem;
}

.additional-domains {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid;
}

/* Multi Domain Input */
.multi-domain-container {
    margin-bottom: 2rem;
}

.multi-domain-textarea {
    width: 100%;
    resize: vertical;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 4px;
    font-family: inherit;
    min-height: 150px;
    transition: all 0.2s ease;
}

.textarea-tip {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
    text-align: center;
}

/* Action Section */
.action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.analyze-button {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: auto;
    min-width: 200px;
}

.analyze-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    margin: 0;
}

.loading-indicator.hidden {
    display: none;
}

.loading-text {
    font-size: 14px;
    text-align: center;
    margin-bottom: 8px;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    transition: width 0.2s ease-out; 
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 100%);
}

/* Results Display */
.result-display {
    margin-top: 2rem;
    border-radius: 6px;
    overflow: hidden;
    max-height: 500px;
    overflow-y: auto;
}

.result-display.hidden {
    display: none;
}

.result-display h3 {
    padding: 10px 15px;
    margin: 0;
    color: white;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.result-display pre {
    margin: 0;
    padding: 15px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    max-height: 450px;
    overflow-y: auto;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-buttons.hidden {
    display: none;
}

.copy-button, .download-button {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-button:hover, .download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Footer */
.app-footer {
    margin-top: 40px;
    padding: 15px 0;
    text-align: center;
    border-top: 1px solid rgba(128, 128, 128, 0.3);
    font-size: 14px;
}

.version-note {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.version-note a {
    color: inherit;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.version-note a:hover {
    opacity: 0.8;
}

.made-with {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.footer-gif {
    height: 24px;
    vertical-align: middle;
}

/* Effects Toggle */
.effects-toggle {
    display: flex;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.effects-toggle.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.effect-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.effect-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.effect-btn.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.effect-icon {
    font-size: 1.1rem;
}

.effect-text {
    font-weight: 500;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
}

.theme-buttons {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
}

.theme-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Animaciones */
.auto-analysis {
    animation: pulse-glow 1s ease-in-out infinite !important;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 53, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
    }
}

/* ===== HISTORIAL ===== */
.history-container {
    padding: 1rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid;
}

.history-header h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-badge {
    background: var(--dotd-accent, #ff9500);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.clear-history-btn {
    padding: 0.6rem 1rem;
    background: linear-gradient(45deg, #dc143c, #b8143c);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: linear-gradient(45deg, #b8143c, #dc143c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.history-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-empty {
    text-align: center;
    padding: 3rem 1rem;
    opacity: 0.6;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.history-empty p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.history-empty small {
    font-size: 0.9rem;
    opacity: 0.8;
}

.history-item {
    border: 1px solid;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-toggle {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 0;
}

.history-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.history-item-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.history-item-title strong {
    font-size: 1rem;
    white-space: nowrap;
}

.history-item-time {
    font-size: 0.85rem;
    opacity: 0.7;
    white-space: nowrap;
}

.history-item-domains {
    font-size: 0.9rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.history-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    min-width: 20px;
}

.history-item.active .toggle-icon {
    transform: rotate(90deg);
}

.history-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.history-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.history-btn-copy:hover {
    background: rgba(34, 139, 34, 0.3);
}

.history-btn-download:hover {
    background: rgba(0, 123, 255, 0.3);
}

.history-btn-delete:hover {
    background: rgba(220, 20, 60, 0.3);
}

.history-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.history-item.active .history-item-content {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-item-content pre {
    margin: 0;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Herencia de colores */
.history-item * {
    color: inherit !important;
}

.history-item-title,
.history-item-title strong,
.history-item-time,
.history-item-domains {
    color: inherit !important;
}

.history-item-info,
.history-toggle,
.history-item-content,
.history-item-content pre {
    color: inherit !important;
}

.history-btn {
    color: inherit !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.history-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .clear-history-btn {
        width: 100%;
    }
    
    .history-item-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .history-item-actions {
        justify-content: space-between;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .history-btn {
        flex: 1;
    }
    
    .history-item-domains {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .history-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .history-item-actions {
        justify-content: space-between;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-left: 0;
    }
    
    .history-item-title {
        justify-content: space-between;
    }
    
    .history-item-domains {
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) {
    .history-item-domains {
        max-width: 300px;
    }
}

/* ===== RAT ===== */
.rat-reminder {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 1000;
}

.rat-reminder.visible {
    opacity: 1;
    transform: translateY(0);
}

.rat-reminder.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.rat-icon {
    font-size: 2.5rem;
    margin-right: 0.5rem;
}

.rat-speech-bubble {
    position: relative;
    padding: 0.75rem 1rem;
    max-width: 250px;
    border-radius: 8px;
}

.rat-speech-bubble:after {
    content: "";
    position: absolute;
    bottom: 15px;
    right: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .rat-reminder {
        bottom: 10px;
        right: 10px;
    }
    
    .rat-icon {
        font-size: 2rem;
    }
    
    .rat-speech-bubble {
        max-width: 200px;
        font-size: 0.9rem;
    }
}

/* ===== MEJORAS ===== */
.theme-btn {
    position: relative;
    overflow: hidden;
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.theme-btn:hover::before {
    width: 100px;
    height: 100px;
}

.theme-btn:active {
    transform: scale(0.95);
}

.copy-button, .download-button {
    position: relative;
    overflow: hidden;
}

.copy-button::after, .download-button::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 24px;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-button.clicked::after, .download-button.clicked::after {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .top-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .effects-toggle, .theme-toggle {
        justify-content: center;
    }
    
    .effect-btn {
        justify-content: center;
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .whois-button, .add-button, .remove-button {
        width: 100%;
    }
    
    .tab-button {
        padding: 0.5rem 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}