*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand-teal: #14919b;
    --brand-teal-dark: #0b5f66;
    --brand-blue: #0f4c81;
    --brand-blue-accent: #1a73e8;
    --brand-gradient: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-blue) 100%);
    --brand-gradient-hover: linear-gradient(135deg, #0f6e76 0%, #0a3760 100%);
    --brand-accent: #1682c1;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    min-height: 100vh;
}

header {
    background: var(--brand-gradient);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
header .logo { font-size: 28px; display: flex; align-items: center; }
header .logo svg { width: 30px; height: 30px; }
header h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
header span { font-size: 13px; opacity: 0.85; }

.container { max-width: 960px; margin: 0 auto; padding: 28px 20px; }

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 28px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 18px;
    color: #0f4c81;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}
.search-box input:focus { border-color: #1a73e8; }

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand-gradient); color: white; }
.btn-primary:hover { background: var(--brand-gradient-hover); box-shadow: 0 4px 14px rgba(15,76,129,0.35); }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: white; color: #0f4c81; border: 2px solid #0f4c81; }
.btn-outline:hover { background: #f0f4f8; }
.btn-danger { background: #dc2626; color: white; }

.chem-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
}

.chem-name { font-size: 22px; font-weight: 700; color: #0f4c81; }
.chem-formula { font-size: 16px; color: #4a5568; margin-top: 4px; }

.mol-thumb {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mol-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mol-thumb-fallback { align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--brand-teal); }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.info-item label { font-size: 11px; color: #718096; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.info-item span { display: block; font-size: 14px; font-weight: 500; margin-top: 2px; }

.signal-word {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}
.signal-danger { background: #fee2e2; color: #dc2626; border: 2px solid #dc2626; }
.signal-warning { background: #fef3c7; color: #d97706; border: 2px solid #d97706; }
.signal-unknown { background: #f1f5f9; color: #64748b; border: 2px solid #cbd5e0; }

.pictograms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
}

.pictogram {
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    width: 88px;
    background: #fafafa;
}
.pictogram img { width: 56px; height: 56px; display: block; margin: 0 auto; }
.pictogram span { font-size: 10px; color: #4a5568; display: block; margin-top: 4px; line-height: 1.3; }

.h-codes, .p-codes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.code-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.code-item .code { font-weight: 700; min-width: 60px; }
.code-item.health { background: #fff1f2; border-left: 3px solid #f43f5e; }
.code-item.physical { background: #fff7ed; border-left: 3px solid #f97316; }
.code-item.environmental { background: #f0fdf4; border-left: 3px solid #22c55e; }
.code-item.p-code { background: #f0f9ff; border-left: 3px solid #38bdf8; }

.reg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.reg-item {
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.reg-item.found { background: #fee2e2; border: 1px solid #fca5a5; }
.reg-item.not-found { background: #f0fdf4; border: 1px solid #86efac; }
.reg-item .icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.reg-item h4 { font-size: 13px; font-weight: 700; }
.reg-item p { font-size: 12px; color: #4a5568; margin-top: 3px; }
.reg-item.found p { color: #991b1b; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.form-group .options { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-option {
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.radio-option:hover { border-color: #1a73e8; background: #eff6ff; }
.radio-option input[type=radio] { accent-color: #1a73e8; }

.obligation-list { display: flex; flex-direction: column; gap: 12px; }
.obligation-item {
    border-radius: 8px;
    padding: 14px;
    border-left: 5px solid;
}
.obligation-acil { background: #fff1f2; border-color: #dc2626; }
.obligation-kritik { background: #fff7ed; border-color: #ea580c; }
.obligation-yuksek { background: #fffbeb; border-color: #d97706; }
.obligation-zorunlu { background: #eff6ff; border-color: #2563eb; }

.obligation-item .ob-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ob-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}
.badge-acil { background: #dc2626; }
.badge-kritik { background: #ea580c; }
.badge-yuksek { background: #d97706; }
.badge-zorunlu { background: #2563eb; }

.obligation-item h3 { font-size: 14px; font-weight: 700; }
.obligation-item p { font-size: 13px; color: #4a5568; margin-top: 4px; }
.obligation-item .deadline { font-size: 12px; color: #6b7280; margin-top: 6px; font-style: italic; }

.what-now {
    background: var(--brand-gradient);
    color: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
}
.what-now h2 { color: white; border-color: rgba(255,255,255,0.3); font-size: 20px; }
.what-now .risk-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    margin: 12px 0;
}
.risk-yuksek { background: #dc2626; }
.risk-orta-yuksek { background: #ea580c; }
.risk-orta { background: #d97706; }
.risk-dusuk { background: #16a34a; }

.action-list { list-style: none; }
.action-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
}
.action-list li::before { content: '→'; font-weight: 700; flex-shrink: 0; margin-top: 1px; }

.urgent-list { list-style: none; }
.urgent-list li {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.urgent-list li::before { content: '⚠'; }

.tabs { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.tab-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-bottom: none;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.2s;
}
.tab-btn.active { background: white; color: #0f4c81; border-color: #0f4c81; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #718096; margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb a { color: #1a73e8; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span.sep { color: #cbd5e0; }

.error-box {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

/* Kırmızı "hata" değil, "bu madde türü kapsam dışı" bilgilendirmesi için —
   kullanıcıya sistemin bozuk olduğu değil, desteklenmeyen bir madde türü
   olduğu hissini vermesi amaçlanır. */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #4a5568;
}
.loading.show { display: block; }

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e2e8f0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.examples { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    color: #1d4ed8;
    cursor: pointer;
    transition: background 0.2s;
}
.example-chip:hover { background: #dbeafe; }

footer {
    text-align: center;
    padding: 20px;
    color: #718096;
    font-size: 12px;
}

.footer-contact {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    color: #4a5568;
}
.footer-contact a {
    color: #1a73e8;
    text-decoration: none;
}
.footer-contact a:hover { text-decoration: underline; }
.footer-contact .whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #25D366;
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
}
.footer-contact .whatsapp-btn:hover { background: #1ebe5c; text-decoration: none; }
.footer-contact .whatsapp-btn svg { width: 16px; height: 16px; fill: #fff; flex-shrink: 0; }

@media (max-width: 600px) {
    .chem-header { grid-template-columns: 1fr; }
    .mol-thumb { width: 64px; height: 64px; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .reg-grid { grid-template-columns: 1fr; }
    .footer-contact { flex-direction: column; gap: 10px; }
}
