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

/* Parser Interface */
.parser-interface {
    margin-bottom: 2rem;
}

/* Toolbar */
.parser-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.toolbar-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

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

.toolbar-btn:hover {
    background: var(--bg-hover, #e8e8e8);
    border-color: var(--border-hover, #d0d0d0);
    transform: translateY(-1px);
}

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

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

.toolbar-btn span {
    display: none;
}

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

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-ready, #6b7280);
    transition: background 0.3s ease;
}

.status-indicator.status-success .status-dot {
    background: var(--status-success, #10b981);
}

.status-indicator.status-error .status-dot {
    background: var(--status-error, #ef4444);
}

.status-indicator.status-processing .status-dot {
    background: var(--status-processing, #f59e0b);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #333);
}

/* Parser Grid */
.parser-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

/* Parser Cards */
.parser-card {
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.parser-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-header-content {
    flex: 1;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0 0 0.5rem 0;
}

.card-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color, #3b82f6);
    flex-shrink: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.card-body {
    flex: 1;
    position: relative;
    min-height: 300px;
    padding: 1rem;
}

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

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
}

/* Parser Editor */
.parser-editor {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

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

.parser-editor-readonly {
    background: var(--bg-secondary, #f9fafb);
}

/* Output Placeholder */
.output-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted, #9ca3af);
    pointer-events: none;
    z-index: 1;
}

.output-placeholder svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.output-placeholder p {
    font-size: 0.875rem;
    margin: 0;
}

/* Error Message */
.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.error-message::before {
    content: "⚠ ";
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    color: var(--text-primary, #333);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.action-btn-primary {
    background: var(--primary-color, #3b82f6);
    border-color: var(--primary-color, #3b82f6);
    color: #ffffff;
}

.action-btn-primary:hover {
    background: var(--primary-hover, #2563eb);
    border-color: var(--primary-hover, #2563eb);
}

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

/* Stats Row */
.stats-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

/* Parser Info */
.parser-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

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

.info-card {
    padding: 1.5rem;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
}

.info-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color, #3b82f6);
    font-weight: 600;
}

.info-list li:first-child {
    padding-top: 0;
}

.info-list li:last-child {
    padding-bottom: 0;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .parser-toolbar {
        padding: 0.75rem;
    }

    .toolbar-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

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

    .card-actions {
        width: 100%;
    }

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

    .card-body {
        padding: 0.75rem;
        min-height: 250px;
    }

    .card-footer {
        padding: 0.75rem 1rem;
    }

    .stats-row {
        gap: 1rem;
    }

    .stat-item {
        flex: 1;
        min-width: 80px;
    }

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

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: #1f2937;
        --bg-secondary: #111827;
        --bg-hover: #374151;
        --border-color: #374151;
        --border-hover: #4b5563;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --primary-color: #60a5fa;
        --primary-hover: #3b82f6;
        --status-ready: #9ca3af;
        --status-success: #34d399;
        --status-error: #f87171;
        --status-processing: #fbbf24;
    }
}
