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

/* Converter Interface */
.converter-interface {
    margin-bottom: 3rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .converter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Input and Output Panels */
.input-panel,
.output-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.2s ease;
}

.output-panel {
    border-color: #3b82f6;
    border-width: 2px;
}

.input-panel:focus-within,
.output-panel:focus-within {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
    border-color: #3b82f6;
}

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

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

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

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

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

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

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

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

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

/* Editor Container */
.editor-container {
    position: relative;
    flex: 1;
    min-height: 300px;
    background: #ffffff;
}

@media (min-width: 768px) {
    .editor-container {
        min-height: 400px;
    }
}

.ace-editor {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

@media (min-width: 768px) {
    .ace-editor {
        min-height: 400px;
    }
}

/* Panel Footer */
.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    gap: 1rem;
    flex-wrap: wrap;
}

.stats-text {
    font-size: 0.8125rem;
    color: #6b7280;
}

.status-text {
    font-size: 0.8125rem;
    color: #059669;
    font-weight: 500;
}

.status-text.error {
    color: #dc2626;
}

/* Options Panel */
.options-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 3rem;
}

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

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.option-item:hover {
    background: #f9fafb;
}

.option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

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

.option-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
}

.option-desc {
    font-size: 0.8125rem;
    color: #6b7280;
}

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

.info-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    padding: 2rem;
}

.info-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
}

.info-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.info-content p {
    font-size: 1rem;
    color: #374151;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-card {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.info-card h4 {
    margin-bottom: 0.75rem;
    color: #111827;
}

.info-card p {
    margin: 0;
    font-size: 0.9375rem;
    color: #4b5563;
    line-height: 1.6;
}

/* Example Section */
.example-section {
    margin-bottom: 2rem;
}

.example-section h4 {
    margin-bottom: 1rem;
}

.example-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.example-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.example-item pre {
    margin: 0;
    padding: 1rem;
    background: #1e293b;
    border-radius: 6px;
    overflow-x: auto;
}

.example-item code {
    font-size: 0.875rem;
    color: #e2e8f0;
    line-height: 1.6;
}

/* Use Cases */
.use-cases {
    margin-top: 2rem;
}

.use-cases h4 {
    margin-bottom: 1rem;
}

.use-cases ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.use-cases li {
    font-size: 1rem;
    color: #374151;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .converter-grid {
        gap: 1rem;
    }

    .panel-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
    }

    .panel-title {
        font-size: 0.9375rem;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .options-panel {
        padding: 1.25rem;
    }

    .info-content {
        padding: 1.5rem;
    }

    .info-content h3 {
        font-size: 1.25rem;
    }

    .info-grid {
        gap: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }

    .example-item pre {
        padding: 0.875rem;
        font-size: 0.8125rem;
    }

    .panel-footer {
        padding: 0.625rem 1rem;
        font-size: 0.75rem;
    }
}

/* Dark mode support for ACE editor */
.ace-editor.ace-monokai {
    background-color: #1e293b !important;
}

/* Copy button success state */
.btn-primary.copied {
    background: #059669;
}

.btn-primary.copied:hover {
    background: #047857;
}

/* Loading state */
.btn-primary.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}