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

/* XML Converter Section */
.xml-converter-section {
    margin-bottom: 3rem;
}

.converter-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.input-container,
.output-container {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-container:hover,
.output-container:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.125rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e1e5e9;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

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

.panel-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.input-indicator {
    background: #dbeafe;
    color: #1e40af;
}

.output-indicator {
    background: #d1fae5;
    color: #065f46;
}

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

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

.control-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #334155;
    transform: translateY(-1px);
}

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

.control-btn svg {
    flex-shrink: 0;
}

.control-btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.control-btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

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

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e1e5e9;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

.info-item {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.error-message {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    flex: 1;
    min-width: 100%;
}

.conversion-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    align-self: center;
}

.arrow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease;
}

.arrow-icon:hover {
    transform: scale(1.1);
}

.arrow-icon svg {
    width: 24px;
    height: 24px;
}

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

.ace_gutter {
    background: #f8fafc;
    border-right: 1px solid #e1e5e9;
}

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

.ace_scrollbar {
    opacity: 0.6;
}

/* Mobile Responsive Design */
@media (max-width: 1024px) {
    .converter-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .conversion-indicator {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

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

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

@media (max-width: 768px) {
    .xml-converter-section {
        margin-bottom: 2rem;
    }

    .converter-layout {
        gap: 1rem;
    }

    .panel-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .panel-title-wrapper {
        margin-bottom: 0.5rem;
    }

    .panel-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .control-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

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

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

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

    .editor-info {
        width: 100%;
    }

    .arrow-icon {
        width: 36px;
        height: 36px;
    }
}

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

    .panel-indicator {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }

    .control-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }

    .control-btn svg {
        width: 16px;
        height: 16px;
    }

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

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

    .info-item {
        font-size: 0.75rem;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .input-container,
    .output-container {
        background: #1e293b;
        border-color: #334155;
    }

    .input-container:hover,
    .output-container:hover {
        border-color: #475569;
    }

    .panel-header {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-bottom-color: #334155;
    }

    .panel-title {
        color: #f1f5f9;
    }

    .control-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .control-btn:hover {
        background: #475569;
        border-color: #64748b;
        color: #f1f5f9;
    }

    .panel-footer {
        background: #0f172a;
        border-top-color: #334155;
    }

    .info-item {
        color: #94a3b8;
    }

    .ace_gutter {
        background: #0f172a;
        border-right-color: #334155;
    }
}
