{% extends '@StartPlatzStyleBundle/base.tailwind.public.html.twig' %}
{% block title %}{{ partner.displayName }} - {% if language == 'en' %}Partners{% else %}Partner{% endif %} | STARTPLATZ{% endblock %}
{% block navigation %}
{% include "@StartPlatzStyleBundle/Navigation/_nav.public.tailwind.html.twig" %}
{% endblock %}
{% block content %}
{# Spacer for fixed nav #}
<div class="h-16"></div>
{# Header: Back-Link + Logo/Name/Category/Location #}
<section class="bg-gray-50 py-10">
<div class="max-w-6xl mx-auto px-4">
{# Back Link #}
<a href="{{ language == 'en' ? path('public_partners_index_en') : path('public_partners_index') }}"
class="inline-flex items-center gap-2 text-gray-500 hover:text-[#7ab800] text-sm mb-6 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
</svg>
{{ language == 'en' ? 'Back to Partners' : 'Zurück zu Partner' }}
</a>
<div class="bg-white rounded-xl p-8 shadow-sm flex flex-col md:flex-row items-start md:items-center gap-8">
{# Logo #}
<div class="flex-shrink-0">
{% set logoUrl = partner.logoOverride ?: (team ? team.logoURL : null) %}
{% if logoUrl %}
<img src="{{ logoUrl }}" alt="{{ partner.displayName }}" class="max-h-20 max-w-[200px] object-contain">
{% else %}
<div class="w-20 h-20 flex items-center justify-center bg-gray-100 rounded-full text-gray-400 text-3xl">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg>
</div>
{% endif %}
</div>
{# Name + Category + Location #}
<div class="flex-grow">
<h1 class="text-3xl font-bold text-gray-900 mb-2">{{ partner.displayName }}</h1>
<div class="flex flex-wrap items-center gap-3">
{% if partner.publicCategory %}
<span class="inline-block px-4 py-1 text-sm font-medium rounded-full bg-teal-100 text-teal-800">
{{ partner.publicCategoryLabel(language) }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
</section>
{# Content: Main + Sidebar #}
<section class="py-12 bg-white">
<div class="max-w-6xl mx-auto px-4">
<div class="flex flex-col lg:flex-row gap-10">
{# Main Content #}
<div class="lg:w-2/3 space-y-8">
{# Practice Description #}
{% if practiceDescription %}
<div class="bg-gray-50 rounded-xl p-8">
<h2 class="text-xl font-semibold text-gray-900 mb-4 pb-2 border-b-[3px] border-[#7ab800]">
{{ language == 'en' ? 'Practice Field' : 'Praxis- und Wirkungsfeld' }}
</h2>
<div class="text-gray-600 leading-relaxed">
{{ practiceDescription|nl2br }}
</div>
</div>
{% endif %}
{# Long Description fallback #}
{% set descLongHtml = (language == 'en' and partner.descriptionLongHtmlEn) ? partner.descriptionLongHtmlEn : partner.descriptionLongHtml %}
{% set descLong = (language == 'en' and partner.descriptionLongEn) ? partner.descriptionLongEn : partner.descriptionLong %}
{% if descLongHtml %}
<div class="text-gray-700 leading-relaxed
[&_h2]:text-2xl [&_h2]:font-semibold [&_h2]:text-gray-900 [&_h2]:mt-8 [&_h2]:mb-4
[&_p]:mb-4 [&_ul]:mb-4 [&_ul]:pl-5 [&_li]:mb-2">
{{ descLongHtml|raw }}
</div>
{% elseif descLong %}
<div class="text-gray-700 leading-relaxed">
{{ descLong|nl2br }}
</div>
{% elseif not practiceDescription %}
<div class="text-gray-700 leading-relaxed">
<h2 class="text-2xl font-semibold text-gray-900 mb-4">
{{ language == 'en' ? 'About ' ~ partner.displayName : 'Über ' ~ partner.displayName }}
</h2>
<p>
{% if language == 'en' %}
{{ partner.displayName }} is a valued partner in the STARTPLATZ network. As part of our ecosystem, they support startups and entrepreneurs with their expertise and services.
{% else %}
{{ partner.displayName }} ist ein geschätzter Partner im STARTPLATZ-Netzwerk. Als Teil unseres Ökosystems unterstützen sie Startups und Unternehmer mit ihrer Expertise und ihren Dienstleistungen.
{% endif %}
</p>
</div>
{% endif %}
{# Signals Section #}
{% if signals is not empty %}
<div>
<h2 class="text-xl font-semibold text-gray-900 mb-6 text-center">
{{ language == 'en' ? 'What We Know' : 'Was wir wissen' }}
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
{% set signalColors = {
danger: { border: 'border-red-500', bg: 'bg-red-500', text: 'text-red-500' },
warning: { border: 'border-yellow-400', bg: 'bg-yellow-400', text: 'text-yellow-600' },
info: { border: 'border-cyan-500', bg: 'bg-cyan-500', text: 'text-cyan-500' },
success: { border: 'border-green-500', bg: 'bg-green-500', text: 'text-green-500' }
} %}
{% set signalIcons = {
'exclamation-triangle': '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"/>',
'puzzle-piece': '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 4a2 2 0 114 0v1a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-1a2 2 0 100 4h1a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-1a2 2 0 10-4 0v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-3a1 1 0 00-1-1H4a2 2 0 110-4h1a1 1 0 001-1V7a1 1 0 011-1h3a1 1 0 001-1V4z"/>',
'lightbulb': '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"/>',
'star': '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"/>'
} %}
{% for typeKey, typeConfig in signalTypes %}
{% set typeSignals = signals[typeKey]|default([]) %}
{% if typeSignals|length > 0 %}
{% set colors = signalColors[typeConfig.color] %}
<div class="bg-white rounded-xl p-6 shadow-sm border-l-4 {{ colors.border }}">
<div class="flex items-center gap-3 mb-4">
<div class="w-10 h-10 rounded-full {{ colors.bg }} flex items-center justify-center text-white flex-shrink-0">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">{{ signalIcons[typeConfig.icon]|raw }}</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900">
{{ language == 'en' ? typeConfig.label_en : typeConfig.label_de }}
</h3>
</div>
<ul class="space-y-2">
{% for signal in typeSignals %}
<li class="flex items-start gap-2 text-sm text-gray-600 py-2 border-b border-gray-100 last:border-0">
<span class="text-gray-400 font-bold mt-0.5">→</span>
{{ signal }}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% else %}
{# No signals placeholder #}
<div class="bg-gray-50 rounded-xl p-12 text-center text-gray-500">
<svg class="w-12 h-12 mx-auto mb-4 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13 10V3L4 14h7v7l9-11h-7z"/>
</svg>
<h4 class="font-semibold text-gray-600 mb-1">{{ language == 'en' ? 'Signals coming soon' : 'Signale folgen' }}</h4>
<p class="text-sm">{{ language == 'en' ? "We're working on detailed insights about this partner." : 'Wir arbeiten an detaillierten Einblicken zu diesem Partner.' }}</p>
</div>
{% endif %}
</div>
{# Sidebar #}
<div class="lg:w-1/3">
<div class="sticky top-24 space-y-5">
{# Member Benefits CTA #}
<div class="bg-gray-50 rounded-xl p-6">
<h3 class="text-base font-semibold text-gray-900 mb-3">
{{ language == 'en' ? 'Want to connect?' : 'Interesse an Zusammenarbeit?' }}
</h3>
<p class="text-sm text-gray-500 mb-4">
{{ language == 'en'
? 'Login to access detailed information and request an introduction.'
: 'Loggen Sie sich ein, um detaillierte Informationen zu erhalten und eine Vorstellung anzufragen.' }}
</p>
<a href="{{ path('connect_partner_show', {slug: partner.slug}) }}"
class="flex items-center justify-center gap-2 w-full px-5 py-3 rounded-lg text-white font-semibold
bg-gradient-to-r from-[#7ab800] to-[#5a8c00]
hover:-translate-y-0.5 hover:shadow-lg hover:shadow-green-200 transition-all">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/>
</svg>
{{ language == 'en' ? 'View Internal Details' : 'Interne Details ansehen' }}
</a>
</div>
{# Website Link #}
{% set metadata = partner.metadata|default({}) %}
{% set homepage = metadata.website|default(team ? team.homepage : null) %}
{% if homepage %}
<div class="bg-gray-50 rounded-xl p-6">
<h3 class="text-base font-semibold text-gray-900 mb-3">Website</h3>
<a href="{{ homepage }}" target="_blank" rel="noopener"
class="flex items-center gap-2 w-full px-4 py-2.5 rounded-lg border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors text-sm">
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
</svg>
<span class="truncate">{{ homepage|replace({'https://': '', 'http://': ''})|trim('/') }}</span>
</a>
</div>
{% endif %}
{# Back to Overview #}
<div class="bg-gray-50 rounded-xl p-6">
<h3 class="text-base font-semibold text-gray-900 mb-3">
{{ language == 'en' ? 'More Partners' : 'Weitere Partner' }}
</h3>
<a href="{{ language == 'en' ? path('public_partners_index_en') : path('public_partners_index') }}"
class="flex items-center gap-2 w-full px-4 py-2.5 rounded-lg border border-blue-300 text-blue-700 hover:bg-blue-50 transition-colors text-sm">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
</svg>
{{ language == 'en' ? 'All Partners' : 'Alle Partner' }}
</a>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}