/* 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);
    }
}

/* Fixer Interface */
.fixer-interface {
    margin-bottom: 2rem;
}

/* Panels */
.fixer-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.fixer-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1.5px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.fixer-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1.5px solid #e9ecef;
    gap: 1rem;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.panel-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.panel-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.panel-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

.panel-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.35);
}

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

.panel-btn-secondary {
    background: #ffffff;
    color: #495057;
    border: 1px solid #dee2e6;
}

.panel-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.panel-btn-secondary:active {
    background: #e9ecef;
}

@media (max-width: 767px) {
    .panel-header {
        flex-wrap: wrap;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
}

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

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    white-space: nowrap;
}

.panel-title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #667eea;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.panel-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.panel-badge-success {
    background: #d1e7dd;
    color: #0f5132;
}

.panel-badge-error {
    background: #f8d7da;
    color: #842029;
}

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

.fixer-editor {
    flex: 1;
    min-height: 400px;
    border: none;
    outline: none;
}

.fixer-editor-readonly {
    background: #f8f9fa;
}

/* Editor Status Bar (VS Code style) */
.editor-statusbar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.375rem 0.75rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.75rem;
    color: #495057;
    min-height: 24px;
    overflow-x: auto;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.5rem;
    border-right: 1px solid #dee2e6;
    white-space: nowrap;
}

.status-item:last-child {
    border-right: none;
    margin-left: auto;
}

.status-label {
    color: #6c757d;
    font-weight: 500;
}

.status-value {
    color: #212529;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
    .editor-statusbar {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
    }
    
    .status-item {
        padding: 0 0.375rem;
    }
    
    .status-item:last-child {
        margin-left: 0;
    }
}

@media (max-width: 991px) {
    .fixer-panels {
        grid-template-columns: 1fr;
    }
    
    .panel-content {
        min-height: 300px;
    }
    
    .fixer-editor {
        min-height: 300px;
    }
}

@media (max-width: 767px) {
    .panel-title {
        font-size: 0.9375rem;
    }
    
    .panel-title svg {
        width: 18px;
        height: 18px;
    }
    
    .panel-content {
        min-height: 250px;
    }
    
    .fixer-editor {
        min-height: 250px;
    }
}

/* Error List */
.error-list {
    padding: 1rem 1.25rem;
    background: #fff3cd;
    border-top: 1.5px solid #ffc107;
    border-radius: 0 0 16px 16px;
    font-size: 0.875rem;
    color: #856404;
    max-height: 150px;
    overflow-y: auto;
}

.error-list::before {
    content: "⚠ ";
    font-weight: 700;
    margin-right: 0.5rem;
}

/* Info Section */
.fixer-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1.5px solid #e9ecef;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.info-header svg {
    width: 24px;
    height: 24px;
    color: #667eea;
    flex-shrink: 0;
}

.info-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

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

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.info-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.info-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.info-text {
    font-size: 0.9375rem;
    color: #495057;
    font-weight: 500;
}

@media (max-width: 767px) {
    .fixer-info {
        padding: 1.25rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ACE Editor Customization */
.ace-xcode .ace_content .ace_variable {
    color: #2d5ada;
}

.ace-xcode .ace_content .ace_string {
    color: #cc5b5c;
}

.ace-xcode .ace_content .ace_constant.ace_numeric {
    color: #008100;
}

.ace-xcode .ace_content .ace_boolean {
    color: #0b7500;
}

.ace-github {
    background: #f8f9fa;
}

.ace-github .ace_gutter {
    background: #f8f9fa;
}

.ace-github .ace_error {
    display: none;
}

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

.stat-value.pulsing {
    animation: pulse 1.5s ease-in-out infinite;
}
