/* ─────────────────────────────────────────────────────────────────────────────
   Gestion de campagne & Paramètres UTM — Stylesheet (Chapitre 7)
   ───────────────────────────────────────────────────────────────────────────── */

/* Hero Overrides */
.resources-hero {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(8, 145, 178, 0.06) 100%);
    padding: 8rem 2.5rem 3rem;
    width: 100%;
    max-width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.resources-hero .chapter-ref {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.resources-hero h1 {
    font-size: 2.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.resources-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Tabs Outer Bar */
.tabs-container-outer {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 72px;
    z-index: 90;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tabs-nav-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2.5rem;
    box-sizing: border-box;
}

.tabs-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 1.1rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--primary);
}

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

/* Main Container */
.tool-main-container {
    width: 100%;
    max-width: 100%;
    margin: 2rem auto 5rem;
    padding: 0 2.5rem;
    box-sizing: border-box;
}

.tab-content {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Presets Section */
.presets-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.presets-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.presets-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.presets-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: var(--primary-glow);
    border-color: var(--border-hover);
    color: var(--primary);
    transform: translateY(-1px);
}

/* 2-Column Grid Layout for Builder */
.utm-builder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .utm-builder-grid {
        grid-template-columns: 1fr;
    }
}

.builder-card,
.output-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

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

.card-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.btn-clean {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clean:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: scale(1.02);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 576px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.req-star {
    color: #ef4444;
}

input[type="text"],
input[type="url"],
select {
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #fff;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.custom-medium-input {
    margin-top: 0.5rem;
}

.field-help {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Accordion */
.accordion-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    user-select: none;
    transition: background var(--transition-fast);
}

.accordion-toggle:hover {
    background: #f1f5f9;
}

.accordion-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.accordion-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.accordion-arrow.rotated {
    transform: rotate(180deg);
}

.advanced-fields {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
}

.advanced-fields.hidden {
    display: none;
}

/* Output Card Panel */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-status.valid {
    background: #dcfce7;
    color: #15803d;
}

.badge-status.warning {
    background: #ffedd5;
    color: #c2410c;
}

.badge-status.error {
    background: #fee2e2;
    color: #b91c1c;
}

.url-result-box {
    margin-bottom: 1.25rem;
}

.url-result-box textarea {
    width: 100%;
    height: 90px;
    padding: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    font-family: monospace;
    font-size: 0.875rem;
    color: #0f172a;
    resize: none;
    word-break: break-all;
    line-height: 1.4;
}

.url-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-orange {
    background: var(--orange);
    color: white;
}

.btn-orange:hover {
    background: var(--orange-hover);
}

/* Audit Feedback List */
.audit-section {
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.audit-section h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.audit-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

.audit-item.success {
    background: #f0fdf4;
    color: #166534;
}

.audit-item.warning {
    background: #fff7ed;
    color: #9a3412;
}

.audit-item.error {
    background: #fef2f2;
    color: #991b1b;
}

.audit-icon {
    font-weight: bold;
    flex-shrink: 0;
}

/* Parameter Breakdown Table */
.breakdown-section h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.breakdown-table th,
.breakdown-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-table th {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
}

.breakdown-table code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.825rem;
    color: var(--primary);
}

/* TAB 2: Batch Matrix */
.batch-intro-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.batch-intro-text h2 {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}

.batch-intro-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 650px;
}

.batch-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.batch-campaign-meta {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 280px;
}

.meta-group label {
    margin-bottom: 0;
    white-space: nowrap;
}

.meta-group input {
    flex: 1;
}

/* Batch Table Styling */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.batch-table th,
.batch-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.batch-table th {
    background: #f8fafc;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
}

.batch-table input[type="text"],
.batch-table input[type="url"],
.batch-table select {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.batch-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.batch-status-dot.valid { background: #22c55e; }
.batch-status-dot.warning { background: #f97316; }
.batch-status-dot.error { background: #ef4444; }

.batch-url-preview {
    font-family: monospace;
    font-size: 0.775rem;
    word-break: break-all;
    max-width: 280px;
    color: #334155;
}

.btn-icon-del {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.btn-icon-del:hover {
    background: #fee2e2;
}

/* TAB 3: Guide de Taxonomie */
.guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }
}

.guide-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.guide-card-full {
    grid-column: 1 / -1;
}

.guide-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.guide-card h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.guide-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.guide-card p {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.guide-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.matrix-table th,
.matrix-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.matrix-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-primary);
}

.matrix-table code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

/* Errors Grid */
.errors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .errors-grid {
        grid-template-columns: 1fr;
    }
}

.error-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
}

.error-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.775rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.error-badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.error-badge.green {
    background: #dcfce7;
    color: #166534;
}

.error-code {
    font-family: monospace;
    font-size: 0.825rem;
    background: #ffffff;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.error-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Utility Hidden */
.hidden {
    display: none !important;
}
