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

/* JSON Cleaner Interface */
.cleaner-interface {
    margin-bottom: 3rem;
}

.cleaner-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.cleaner-controls {
    padding: 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.cleaner-main {
    display: flex;
    flex-direction: row;
    min-height: 500px;
}

/* Panel Styles */
.cleaner-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    flex: 1;
    min-width: 0;
}

.cleaner-panel-input {
    border-right: 1px solid #e5e7eb;
}

.cleaner-panel-output {
    border-left: 1px solid #e5e7eb;
}

.cleaner-divider {
    width: 1px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.panel-title-group {
    flex: 1;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.btn-icon:active {
    transform: scale(0.95);
}

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

/* Editor Wrapper */
.editor-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px;
}

.editor-container {
    flex: 1;
    min-height: 400px;
    border: none;
    background: #ffffff;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8125rem;
}

.editor-status {
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.editor-status.error::before {
    background: #ef4444;
}

.editor-size {
    color: #6b7280;
    font-weight: 500;
}

.editor-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-item {
    color: #6b7280;
    font-weight: 500;
}

.stat-savings {
    color: #10b981;
    font-weight: 600;
}

/* Controls Section */
.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.controls-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.btn-toggle-all {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-all:hover {
    background: #ffffff;
    border-color: #9ca3af;
    color: #111827;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-item:hover {
    border-color: #d1d5db;
    background: #fafafa;
}

.control-item:has(input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.control-checkbox {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #3b82f6;
}

.control-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
}

.control-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.btn-clean {
    display: none;
}

/* Info Section */
.cleaner-info {
    margin-bottom: 3rem;
}

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

.info-card {
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

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

.info-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    color: #3b82f6;
    margin-bottom: 1.25rem;
}

.info-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.info-text {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .cleaner-main {
        flex-direction: column;
        min-height: auto;
    }

    .cleaner-panel-input {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .cleaner-panel-output {
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }

    .cleaner-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .cleaner-card {
        border-radius: 12px;
    }

    .panel-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

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

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

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

    .editor-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .editor-stats {
        width: 100%;
        justify-content: space-between;
    }

    .cleaner-controls {
        padding: 1.25rem 1rem;
    }

    .cleaner-main {
        min-height: auto;
    }

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

    .btn-toggle-all {
        width: 100%;
    }

    .controls-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .control-item {
        padding: 0.75rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .panel-title {
        font-size: 1.125rem;
    }

    .panel-subtitle {
        font-size: 0.8125rem;
    }

    .editor-wrapper {
        min-height: 250px;
    }

    .editor-container {
        min-height: 250px;
    }

    .controls-title {
        font-size: 1rem;
    }

    .btn-clean {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* Ace Editor Customization */
.ace_editor {
    border-radius: 0;
}

.ace_gutter {
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
}

.ace_gutter-active-line {
    background: #f3f4f6;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #3b82f6;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
