/* Standardized Subtabs Styles for Developer Tools */

/* Universal subtab container styles */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
    gap: 0;
    background: transparent;
}

/* Universal subtab button styles */
.tab-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-bottom: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    position: relative;
    min-width: 120px;
    text-align: center;
    outline: none;
}

/* Hover state for subtab buttons */
.tab-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Active state for subtab buttons - Enhanced visibility */
.tab-btn.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    z-index: 2;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* Enhanced active state indicator */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

/* Focus state for accessibility */
.tab-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    z-index: 3;
}

/* Disabled state */
.tab-btn:disabled {
    background: var(--bg-secondary);
    color: var(--text-disabled);
    border-color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.tab-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Tab content containers */
.tab-content {
    display: none;
    animation: fadeInTab 0.3s ease-out;
}

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

/* Smooth fade-in animation for tab content */
@keyframes fadeInTab {
    from { 
        opacity: 0; 
        transform: translateY(10px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* Enhanced styling for specific tool containers */
.json-tabs .tab-btn.active,
.base64-tabs .tab-btn.active,
.url-encoder-tabs .tab-btn.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* Dark theme adjustments */
[data-theme="dark"] .tab-btn.active {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .tab-btn:hover:not(.active) {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* High contrast theme adjustments */
[data-theme="high-contrast"] .tab-btn {
    border-width: 2px;
}

[data-theme="high-contrast"] .tab-btn.active {
    border-width: 2px;
    color: var(--primary-color);
    background: var(--bg-primary);
}

[data-theme="high-contrast"] .tab-btn.active::after {
    height: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .tab-btn {
        min-width: 100px;
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .tab-nav {
        flex-direction: column;
        border-bottom: none;
        gap: 2px;
    }
    
    .tab-btn {
        border-radius: var(--border-radius, 6px);
        border: 1px solid var(--border-light);
        margin-bottom: 0;
        min-width: auto;
    }
    
    .tab-btn.active::after {
        display: none;
    }
    
    .tab-btn.active {
        border-left: 4px solid var(--primary-color);
        padding-left: calc(1rem - 3px);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .tab-btn {
        transition: none;
    }
    
    .tab-content {
        animation: none;
    }
    
    .tab-btn:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .tab-nav {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .tab-content:not(:first-of-type) {
        page-break-before: always;
    }
}
