/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Minifier Interface */
.minifier-interface {
    margin-top: 1rem;
}

/* Stats Section */
.minifier-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #dee2e6;
}

.stat-card-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
}

.stat-card-highlight .stat-icon svg {
    color: #ffffff;
}

.stat-card-highlight .stat-label,
.stat-card-highlight .stat-unit {
    color: rgba(255, 255, 255, 0.9);
}

.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.stat-card-highlight .stat-icon {
    background: rgba(255, 255, 255, 0.2);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: #667eea;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #212529;
    word-break: break-all;
}

.stat-card-highlight .stat-value {
    color: #ffffff;
}

.stat-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

.stat-card-highlight .stat-unit {
    color: rgba(255, 255, 255, 0.9);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    margin-top: 0.125rem;
}

@media (max-width: 767px) {
    .minifier-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-unit {
        font-size: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Single Card with Two Columns */
.minifier-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.minifier-card-content {
    display: flex;
    flex: 1;
}

.card-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-column-input {
    border-right: 1px solid #e9ecef;
}

.card-column-output {
    border-right: none;
}

.column-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.column-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.column-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    line-height: 1.4;
}

.column-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    background: #e9ecef;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.column-badge[data-status="ready"] {
    background: #d1e7dd;
    color: #0f5132;
}

.column-badge[data-status="processing"] {
    background: #fff3cd;
    color: #856404;
}

.column-badge[data-status="error"] {
    background: #f8d7da;
    color: #842029;
}

.column-badge[data-status="success"] {
    background: #d1e7dd;
    color: #0f5132;
}

.column-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.editor-container {
    position: relative;
    flex: 1;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.json-editor {
    flex: 1;
    min-height: 400px;
    width: 100%;
}

.error-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem;
    color: #c53030;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

@media (max-width: 1023px) {
    .minifier-card-content {
        flex-direction: column;
    }

    .card-column-input {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .column-header {
        padding: 0.875rem 1rem;
    }

    .column-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    .action-btn span {
        display: none;
    }

    .action-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 767px) {
    .minifier-interface {
        margin-top: 1.5rem;
    }

    .column-header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .column-title-group {
        width: 100%;
    }

    .column-actions {
        width: 100%;
        gap: 0.375rem;
    }

    .action-btn {
        padding: 0.5rem;
        flex: 1;
    }

    .json-editor {
        min-height: 300px;
    }
}

/* Meta Section */
.minifier-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    font-size: 0.875rem;
    color: #6c757d;
}

.meta-author,
.meta-updated {
    margin: 0;
}

@media (max-width: 767px) {
    .minifier-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
}

/* ACE Editor Customization */
.ace_editor {
    font-size: 14px;
    line-height: 1.6;
}

.ace_gutter {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

.ace_scroller {
    background: #ffffff;
}

.card-column .ace_editor {
    border-radius: 0;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.column-badge[data-status="processing"] {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth Transitions */
.stat-value,
.stat-label,
.column-badge {
    transition: all 0.3s ease;
}

/* Focus States */
.action-btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .column-actions,
    .minifier-stats,
    .minifier-meta {
        display: none;
    }

    .minifier-card {
        border: none;
        box-shadow: none;
    }
}
