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

/* TOML Converter Styles */
.toml-converter-wrapper {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

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

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.input-section:focus-within,
.output-section:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #3b82f6);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--header-bg, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #111827);
}

.format-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toml-badge {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: #ffffff;
}

.json-badge {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: #ffffff;
}

.section-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--button-bg, #ffffff);
    border-radius: 6px;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--button-hover-bg, #f3f4f6);
    border-color: var(--primary-color, #3b82f6);
    color: var(--primary-color, #3b82f6);
}

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

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

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

.code-editor {
    flex: 1;
    width: 100%;
    padding: 1.25rem;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary, #111827);
    background: var(--editor-bg, #ffffff);
    tab-size: 2;
}

.code-editor::placeholder {
    color: var(--text-muted, #9ca3af);
}

.code-editor:read-only {
    background: var(--readonly-bg, #f9fafb);
    cursor: default;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--footer-bg, #f9fafb);
    border-top: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.875rem;
}

.char-count {
    color: var(--text-muted, #6b7280);
    font-size: 0.8125rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
}

.status-indicator.success .status-text {
    color: #10b981;
}

.status-indicator.error .status-text {
    color: #ef4444;
}

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

.indicator-line {
    width: 2px;
    height: 100%;
    min-height: 60px;
    background: linear-gradient(180deg, var(--border-color, #e5e7eb) 0%, transparent 100%);
}

.convert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--primary-color, #3b82f6);
    background: var(--primary-color, #3b82f6);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.convert-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

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

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    display: none;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #dc2626;
}

.error-content svg {
    flex-shrink: 0;
}

.error-text {
    font-size: 0.875rem;
    line-height: 1.5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .conversion-indicator {
        flex-direction: row;
        padding: 0.5rem 0;
    }

    .indicator-line {
        width: 100%;
        height: 2px;
        min-height: 2px;
        background: linear-gradient(90deg, transparent 0%, var(--border-color, #e5e7eb) 50%, transparent 100%);
    }

    .convert-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .toml-converter-wrapper {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .section-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

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

    .section-controls {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }

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

    .code-editor {
        padding: 1rem;
        font-size: 13px;
    }

    .editor-footer {
        padding: 0.625rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .format-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.625rem;
    }
}

@media (max-width: 480px) {
    .converter-container {
        gap: 0.75rem;
    }

    .input-section,
    .output-section {
        border-radius: 8px;
    }

    .section-header {
        padding: 0.75rem;
    }

    .code-editor {
        padding: 0.875rem;
        font-size: 12px;
    }

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

    .convert-btn {
        width: 36px;
        height: 36px;
    }

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

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    .input-section,
    .output-section {
        background: var(--card-bg-dark, #1f2937);
        border-color: var(--border-color-dark, #374151);
    }

    .section-header {
        background: var(--header-bg-dark, #111827);
        border-color: var(--border-color-dark, #374151);
    }

    .section-title {
        color: var(--text-primary-dark, #f9fafb);
    }

    .code-editor {
        background: var(--editor-bg-dark, #1f2937);
        color: var(--text-primary-dark, #f9fafb);
    }

    .code-editor:read-only {
        background: var(--readonly-bg-dark, #111827);
    }

    .editor-footer {
        background: var(--footer-bg-dark, #111827);
        border-color: var(--border-color-dark, #374151);
    }

    .control-btn {
        background: var(--button-bg-dark, #1f2937);
        border-color: var(--border-color-dark, #374151);
        color: var(--text-secondary-dark, #9ca3af);
    }

    .control-btn:hover {
        background: var(--button-hover-bg-dark, #374151);
    }
}
