@model CarneiroTech.Models.CaseModel

<!-- Case Detail Header -->
<section class="page-section" style="padding-top: 150px;">
    <div class="container">
        <!-- Header -->
        <div class="row mb-5">
            <div class="col-lg-12 text-center">
                <h1 class="display-4 mb-4">@Model.Metadata.Title</h1>
                <p class="lead text-muted mb-4">@Model.Metadata.Summary</p>

                <!-- Meta Information -->
                <div class="row justify-content-center mb-4">
                    @if (!string.IsNullOrEmpty(Model.Metadata.Client))
                    {
                        <div class="col-md-3 mb-2">
                            <strong>Cliente:</strong> @Model.Metadata.Client
                        </div>
                    }
                    @if (!string.IsNullOrEmpty(Model.Metadata.Industry))
                    {
                        <div class="col-md-3 mb-2">
                            <strong>Indústria:</strong> @Model.Metadata.Industry
                        </div>
                    }
                    @if (!string.IsNullOrEmpty(Model.Metadata.Timeline))
                    {
                        <div class="col-md-3 mb-2">
                            <strong>Timeline:</strong> @Model.Metadata.Timeline
                        </div>
                    }
                    @if (!string.IsNullOrEmpty(Model.Metadata.Role))
                    {
                        <div class="col-md-3 mb-2">
                            <strong>Meu Role:</strong> @Model.Metadata.Role
                        </div>
                    }
                </div>

                <!-- Tags -->
                @if (Model.Metadata.Tags.Any())
                {
                    <div class="tags mt-3 mb-4">
                        @foreach (var tag in Model.Metadata.Tags)
                        {
                            <a href="/cases?tag=@tag" class="badge bg-primary me-2 mb-2 text-decoration-none" style="font-size: 0.9rem; padding: 0.5rem 1rem;">@tag</a>
                        }
                    </div>
                }
            </div>
        </div>

        <!-- Content -->
        <div class="row">
            <div class="col-lg-10 mx-auto">
                <div class="case-content">
                    @Html.Raw(Model.ContentHtml)
                </div>
            </div>
        </div>

        <!-- Navigation -->
        <div class="row mt-5">
            <div class="col-lg-12 text-center">
                <a href="/cases" class="btn btn-outline-primary btn-lg">
                    <i class="fas fa-arrow-left me-2"></i>Ver Todos os Cases
                </a>
                <a href="/#contact" class="btn btn-primary btn-lg ms-2">
                    <i class="fas fa-envelope me-2"></i>Vamos Conversar
                </a>
            </div>
        </div>
    </div>
</section>

@section Scripts {
    <!-- Syntax highlighting for code blocks (optional) -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
    <script>hljs.highlightAll();</script>

    <style>
        .case-content {
            font-size: 1.1rem;
            line-height: 1.8;
        }

        .case-content h2 {
            margin-top: 2.5rem;
            margin-bottom: 1.5rem;
            font-weight: bold;
            border-bottom: 2px solid #C42127;
            padding-bottom: 0.5rem;
        }

        .case-content h3 {
            margin-top: 2rem;
            margin-bottom: 1rem;
            font-weight: 600;
        }

        .case-content h4 {
            margin-top: 1.5rem;
            margin-bottom: 1rem;
            font-weight: 600;
            color: #212529;
        }

        .case-content p {
            margin-bottom: 1.2rem;
        }

        .case-content ul,
        .case-content ol {
            margin-bottom: 1.5rem;
            padding-left: 2rem;
        }

        .case-content li {
            margin-bottom: 0.5rem;
        }

        .case-content pre {
            background-color: #f8f9fa;
            border-left: 4px solid #C42127;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border-radius: 0.375rem;
            overflow-x: auto;
        }

        .case-content code {
            background-color: #f8f9fa;
            padding: 0.2rem 0.4rem;
            border-radius: 0.25rem;
            font-size: 0.9em;
            color: #e83e8c;
        }

        .case-content pre code {
            background-color: transparent;
            padding: 0;
            color: inherit;
        }

        .case-content blockquote {
            border-left: 4px solid #C42127;
            padding-left: 1.5rem;
            margin: 1.5rem 0;
            font-style: italic;
            color: #6c757d;
        }

        .case-content img {
            max-width: 100%;
            height: auto;
            margin: 2rem 0;
            border-radius: 0.375rem;
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }

        .case-content table {
            width: 100%;
            margin: 1.5rem 0;
            border-collapse: collapse;
        }

        .case-content table th,
        .case-content table td {
            padding: 0.75rem;
            border: 1px solid #dee2e6;
        }

        .case-content table th {
            background-color: #f8f9fa;
            font-weight: 600;
        }

        .case-content hr {
            margin: 2rem 0;
            border-top: 2px solid #dee2e6;
        }
    </style>
}
