<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ $blog->title }}</title>
    <!-- Load Bootstrap CSS -->
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
    <!-- Load Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: 'Roboto';
            background-color: #f8f9fa;
            color: #333;
        }

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

        .blog-title {
            font-size: 36px;
            font-weight: bold;
            color: #333;
            margin-bottom: 20px;
            animation: fadeIn 1s ease;
        }

        .blog-author {
            font-size: 16px;
            color: #666;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            animation: slideInLeft 1s ease;
        }

        .blog-author i {
            margin-right: 5px;
        }

        .blog-content {
        font-size: 18px;
        line-height: 1.6;
        margin-bottom: 30px;
        text-align: justify;
        animation: slideInRight 1s ease;
        white-space: pre-wrap; /* Menjaga enter dan whitespace lainnya */
        }

        .btn-back {
            background-color: #7AB2B2;
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            text-decoration: none;
            transition: background-color 0.3s ease;
            display: inline-block;
            animation: bounce 1s infinite alternate;
        }

        .btn-back:hover {
            background-color: #4D869C;
        }

        .btn-back i {
            margin-right: 5px;
        }

        .blog-image {
            max-width: 100%;
            height: auto;
            margin-bottom: 20px;
            display: block;
            margin-left: auto;
            margin-right: auto;
            animation: zoomIn 1s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        @keyframes slideInLeft {
            from {
                transform: translateX(-50px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideInRight {
            from {
                transform: translateX(50px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes bounce {
            0% {
                transform: translateY(0);
            }
            100% {
                transform: translateY(-10px);
            }
        }

        @keyframes zoomIn {
            from {
                transform: scale(0);
            }
            to {
                transform: scale(1);
            }
        }
    </style>
</head>
<body>
    <div class="container mt-5">
        <h1 class="blog-title">{{ $blog->title }}</h1>
        <p class="blog-author"><i class="fas fa-user"></i> Penulis: {{ $blog->author }}</p>
        @if($blog->image)
            <img src="{{ asset('images/' . $blog->image) }}" alt="{{ $blog->title }}" class="blog-image">
        @endif
        <p class="blog-content">{{ $blog->content }}</p>
        <a href="{{ route('home') }}" class="btn btn-back">
            <i class="fas fa-arrow-left"></i> Kembali ke Halaman Utama
        </a>
    </div>
</body>
</html>
