/* Compression Tool Styles */

.tab-button {
    color: #6b7280;
    border-color: transparent;
    transition: all 0.2s ease-in-out;
}

.tab-button:hover {
    color: #374151;
    border-color: #d1d5db;
}

.tab-button.active {
    color: #3b82f6;
    border-color: #3b82f6;
}

.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Code Display */
.code-container {
    position: relative;
    background-color: #1f2937;
    border-radius: 0.5rem;
    overflow: hidden;
}

.code-container pre {
    margin: 0;
    padding: 1rem;
    background-color: transparent;
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 16rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Copy Button */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.copy-button:hover {
    background-color: #4b5563;
    transform: scale(1.05);
}

.copy-button.copied {
    background-color: #10b981 !important;
}

/* Stats Cards */
.stat-card {
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* File Type Indicators */
.file-type-css {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.file-type-js {
    background-color: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.file-type-html {
    background-color: #fce7f3;
    border-color: #ec4899;
    color: #be185d;
}

/* Compression Ratio Bar */
.compression-bar {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #e5e7eb;
    overflow: hidden;
    margin-top: 0.5rem;
}

.compression-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    transition: width 0.5s ease;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Action Buttons */
.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* File Info Section */
.file-info {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.file-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.file-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.file-info-item:last-child {
    border-bottom: none;
}

.file-info-label {
    font-weight: 600;
    color: #374151;
}

.file-info-value {
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tab-button {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .file-info-grid {
        grid-template-columns: 1fr;
    }
    
    .code-container pre {
        font-size: 0.75rem;
        max-height: 12rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .action-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .file-info {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .file-info-label {
        color: #f9fafb;
    }
    
    .file-info-value {
        color: #d1d5db;
    }
}

/* Animation for success/error messages */
.alert-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.alert-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert-exit {
    opacity: 1;
    transform: translateY(0);
}

.alert-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Custom scrollbar for code areas */
.code-container pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.code-container pre::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 3px;
}

.code-container pre::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.code-container pre::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Focus states for better accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Hover effects for interactive elements */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Transition for smooth interactions */
.smooth-transition {
    transition: all 0.2s ease-in-out;
}
