/* Tool Hero Section - Required by structure rules */
.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 Validator Styles */
.toml-validator-wrapper {
    margin-bottom: 2rem;
}

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

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    color: var(--text-primary, #1a1a1a);
}

.btn-action:hover {
    background: var(--bg-hover, #e8e8e8);
    border-color: var(--border-hover, #d0d0d0);
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    display: none;
}

@media (min-width: 640px) {
    .btn-text {
        display: inline;
    }
}

/* Input Section */
.input-section {
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.editor-wrapper {
    position: relative;
}

.toml-editor {
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-editor, #fafafa);
    color: var(--text-primary, #1a1a1a);
    transition: border-color 0.2s ease;
}

.toml-editor:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    background: var(--bg-primary, #ffffff);
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
}

/* Result Section */
.result-section {
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    background: var(--bg-secondary, #f5f5f5);
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted, #999);
    display: inline-block;
}

.status-indicator.valid .status-dot {
    background: #10b981;
}

.status-indicator.invalid .status-dot {
    background: #ef4444;
}

.status-text {
    font-weight: 500;
}

.result-content {
    margin-top: 1rem;
    min-height: 100px;
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #666);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.result-success {
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
}

.result-success-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-error {
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
}

.result-error-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Details Section */
.details-section {
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.details-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted, #666);
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: -2px;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-secondary, #f5f5f5);
}

.tab-btn.active {
    color: var(--primary-color, #007bff);
    border-bottom-color: var(--primary-color, #007bff);
}

.tab-icon {
    font-size: 1rem;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Structure Viewer */
.structure-viewer {
    max-height: 500px;
    overflow: auto;
    padding: 1rem;
    background: var(--bg-editor, #fafafa);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
}

.structure-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #666);
}

.structure-json {
    color: var(--text-primary, #1a1a1a);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Errors List */
.errors-list {
    max-height: 500px;
    overflow-y: auto;
}

.errors-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #666);
}

.error-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
}

.error-line {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.error-message {
    color: #7f1d1d;
    font-size: 0.875rem;
}

/* Info Content */
.info-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #1a1a1a);
}

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

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

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

.info-item {
    padding: 1rem;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 8px;
}

.info-item h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1a1a1a);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item code {
    display: block;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-primary, #1a1a1a);
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .toml-validator-wrapper {
        margin-top: 1.5rem;
    }

    .input-section,
    .result-section,
    .details-section {
        padding: 1rem;
    }

    .toml-editor {
        min-height: 300px;
        font-size: 13px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .btn-action {
        flex: 1;
        justify-content: center;
    }

    .details-tabs {
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .tab-text {
        display: none;
    }

    .tab-icon {
        font-size: 1.125rem;
    }

    .structure-viewer {
        max-height: 300px;
        font-size: 12px;
    }

    .errors-list {
        max-height: 300px;
    }
}

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2a2a2a;
        --bg-editor: #252525;
        --bg-hover: #333333;
        --text-primary: #e0e0e0;
        --text-muted: #999;
        --border-color: #404040;
        --border-hover: #505050;
        --primary-color: #4a9eff;
    }
}
