<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Invoice Already Paid</title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #333;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        .message-container {
            text-align: center;
            background-color: #fff;
            padding: 50px;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            max-width: 500px;
            width: 90%;
            position: relative;
        }
        .message-icon {
            font-size: 5rem;
            color: #00b894;
            margin-bottom: 30px;
            animation: checkmarkAnimation 1.5s ease-out;
        }

        @keyframes checkmarkAnimation {
            0% {
                transform: scale(0) rotate(-180deg);
                opacity: 0;
            }
            50% {
                transform: scale(1.2) rotate(0deg);
                opacity: 1;
            }
            70% {
                transform: scale(0.9) rotate(0deg);
            }
            100% {
                transform: scale(1) rotate(0deg);
                opacity: 1;
            }
        }

        .message-title {
            font-size: 2.5rem;
            margin-bottom: 20px;
            color: #333;
            font-weight: 700;
        }

        .message-text {
            font-size: 1.2rem;
            line-height: 1.6;
            margin-bottom: 20px;
            color: #666;
            font-weight: 400;
        }

        .invoice-number {
            background-color: #e3f2fd;
            padding: 15px;
            border-radius: 8px;
            margin: 20px 0;
            border-left: 4px solid #2196f3;
            font-size: 1.1rem;
            font-weight: 600;
            color: #1976d2;
        }

        .contact-section {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
            margin-top: 30px;
            text-align: left;
        }

        .contact-section h3 {
            margin: 0 0 10px 0;
            color: #333;
            font-size: 1.3rem;
            font-weight: 600;
        }

        .contact-section > p {
            margin: 0 0 15px 0;
            color: #666;
            font-size: 0.95rem;
        }

        .contact-details {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .contact-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 5px 0;
            border-bottom: 1px solid #e9ecef;
        }

        .contact-row:last-child {
            border-bottom: none;
        }

        .contact-label {
            font-weight: 500;
            color: #495057;
            flex-shrink: 0;
        }

        .contact-value {
            font-weight: 400;
            color: #6c757d;
            text-align: right;
        }

        .contact-value a {
            color: #007bff;
            text-decoration: none;
        }

        .contact-value a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="message-container">
        <div class="message-icon">✓</div>
        <h1 class="message-title">Invoice Already Paid</h1>
        <p class="message-text">This invoice has already been paid in full.</p>

        {% if invoice_number %}
        <div class="invoice-number">
            Invoice #{{ invoice_number }}
        </div>
        {% endif %}

        {% if company %}
        <div class="contact-section">
            <h3>Have Questions?</h3>
            <p>We're here to help! Contact us if you need assistance.</p>
            <div class="contact-details">
                {% if company.company_name %}
                    <div class="contact-row">
                        <span class="contact-label">Company:</span>
                        <span class="contact-value">{{ company.company_name }}</span>
                    </div>
                {% endif %}

                {% if company.phone_no %}
                    <div class="contact-row">
                        <span class="contact-label">Phone:</span>
                        <span class="contact-value">{{ company.phone_no }}</span>
                    </div>
                {% endif %}

                {% if company.email %}
                    <div class="contact-row">
                        <span class="contact-label">Email:</span>
                        <span class="contact-value"><a href="mailto:{{ company.email }}">{{ company.email }}</a></span>
                    </div>
                {% endif %}

                {% if company.website %}
                    <div class="contact-row">
                        <span class="contact-label">Website:</span>
                        <span class="contact-value"><a href="{{ company.website }}" target="_blank">{{ company.website }}</a></span>
                    </div>
                {% endif %}
            </div>
        </div>
        {% endif %}
    </div>
</body>
</html>