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

/* Detector Wrapper */
.detector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 2rem;
}

/* Detector Card */
.detector-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Input Section */
.input-section {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-label {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

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

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-size: 14px;
}

.textarea-container {
    position: relative;
}

.analysis-input {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.analysis-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.analysis-input::placeholder {
    color: #9ca3af;
}

.input-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.char-indicator {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Detection Section */
.detection-section {
    padding: 24px;
}

.detection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.detection-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.detection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
}

.detection-status.detected {
    background: #d1fae5;
    color: #065f46;
}

.detection-status.not-detected {
    background: #fee2e2;
    color: #991b1b;
}

.detection-status.uncertain {
    background: #fef3c7;
    color: #92400e;
}

.status-icon {
    font-size: 16px;
}

.status-text {
    font-size: 14px;
}

.detection-content {
    min-height: 120px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Detection Results */
.detection-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.confidence-meter {
    margin-bottom: 20px;
}

.confidence-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.confidence-text {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.confidence-value {
    font-size: 18px;
    font-weight: 700;
    color: #3b82f6;
}

.confidence-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.format-badge.url-safe {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.analysis-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.card-icon {
    font-size: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.card-body {
    padding: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
}

.issue-item:last-child {
    margin-bottom: 0;
}

.issue-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.issue-text {
    font-size: 13px;
    color: #92400e;
    margin: 0;
    line-height: 1.5;
}

.no-issues {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .detector-wrapper {
        margin-top: 24px;
        gap: 16px;
    }

    .input-section,
    .detection-section {
        padding: 16px;
    }

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

    .section-actions {
        width: 100%;
    }

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

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

    .analysis-input {
        min-height: 160px;
        font-size: 13px;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .confidence-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .detector-card {
        border-radius: 12px;
    }

    .input-section,
    .detection-section {
        padding: 12px;
    }

    .section-label {
        font-size: 14px;
    }

    .detection-title {
        font-size: 18px;
    }

    .action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .btn-text {
        display: none;
    }

    .action-btn .btn-icon {
        margin: 0;
    }
}
