<!DOCTYPE html>
<html lang="{{ locale | default('es') }}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}{{ subject | default('DentalPin') }}{% endblock %}</title>
    <style>
        /* Reset styles */
        body, table, td, p, a, li {
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%;
        }
        table, td {
            mso-table-lspace: 0pt;
            mso-table-rspace: 0pt;
        }
        img {
            -ms-interpolation-mode: bicubic;
            border: 0;
            height: auto;
            line-height: 100%;
            outline: none;
            text-decoration: none;
        }

        /* Base styles */
        body {
            margin: 0;
            padding: 0;
            width: 100%;
            background-color: #f4f4f5;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            font-size: 16px;
            line-height: 1.5;
            color: #18181b;
        }

        /* Container */
        .email-container {
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }

        /* Card */
        .email-card {
            background-color: #ffffff;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        /* Header */
        .email-header {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            padding: 24px 32px;
            text-align: center;
        }

        .email-header h1 {
            margin: 0;
            color: #ffffff;
            font-size: 24px;
            font-weight: 600;
        }

        .email-header .logo {
            font-size: 28px;
            font-weight: 700;
            color: #ffffff;
            text-decoration: none;
        }

        /* Body */
        .email-body {
            padding: 32px;
        }

        .email-body h2 {
            margin: 0 0 16px;
            font-size: 20px;
            font-weight: 600;
            color: #18181b;
        }

        .email-body p {
            margin: 0 0 16px;
            color: #3f3f46;
        }

        .email-body p:last-child {
            margin-bottom: 0;
        }

        /* Info box */
        .info-box {
            background-color: #f4f4f5;
            border-radius: 6px;
            padding: 16px 20px;
            margin: 20px 0;
        }

        .info-box .label {
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #71717a;
            margin-bottom: 4px;
        }

        .info-box .value {
            font-size: 16px;
            font-weight: 500;
            color: #18181b;
        }

        .info-row {
            display: flex;
            margin-bottom: 12px;
        }

        .info-row:last-child {
            margin-bottom: 0;
        }

        /* Button */
        .button-container {
            text-align: center;
            margin: 24px 0;
        }

        .button {
            display: inline-block;
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: #ffffff !important;
            text-decoration: none;
            font-weight: 600;
            font-size: 16px;
            padding: 12px 32px;
            border-radius: 6px;
            transition: opacity 0.2s;
        }

        .button:hover {
            opacity: 0.9;
        }

        .button-secondary {
            background: #f4f4f5;
            color: #18181b !important;
        }

        /* Alert boxes */
        .alert {
            padding: 16px 20px;
            border-radius: 6px;
            margin: 20px 0;
        }

        .alert-info {
            background-color: #eff6ff;
            border-left: 4px solid #3b82f6;
        }

        .alert-success {
            background-color: #f0fdf4;
            border-left: 4px solid #22c55e;
        }

        .alert-warning {
            background-color: #fffbeb;
            border-left: 4px solid #f59e0b;
        }

        .alert-error {
            background-color: #fef2f2;
            border-left: 4px solid #ef4444;
        }

        /* Footer */
        .email-footer {
            padding: 24px 32px;
            text-align: center;
            border-top: 1px solid #e4e4e7;
        }

        .email-footer p {
            margin: 0 0 8px;
            font-size: 14px;
            color: #71717a;
        }

        .email-footer a {
            color: #3b82f6;
            text-decoration: none;
        }

        .email-footer .clinic-info {
            margin-top: 16px;
            font-size: 12px;
            color: #a1a1aa;
        }

        /* Responsive */
        @media only screen and (max-width: 600px) {
            .email-container {
                padding: 10px;
            }

            .email-header {
                padding: 20px;
            }

            .email-body {
                padding: 24px 20px;
            }

            .email-footer {
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="email-container">
        <div class="email-card">
            <!-- Header -->
            <div class="email-header">
                <span class="logo">{{ clinic_name | default('DentalPin') }}</span>
            </div>

            <!-- Body -->
            <div class="email-body">
                {% block content %}{% endblock %}
            </div>

            <!-- Footer -->
            <div class="email-footer">
                {% block footer %}
                <p>{{ footer_sent_by | default('Este email fue enviado por ' ~ (clinic_name | default('DentalPin'))) }}</p>
                {% if clinic_phone %}
                <p>Tel: {{ clinic_phone }}</p>
                {% endif %}
                {% if clinic_address %}
                <p class="clinic-info">{{ clinic_address }}</p>
                {% endif %}
                {% endblock %}
            </div>
        </div>

        <p style="text-align: center; margin-top: 20px; font-size: 12px; color: #a1a1aa;">
            Powered by <a href="https://dentalpin.com" style="color: #3b82f6; text-decoration: none;">DentalPin</a>
        </p>
    </div>
</body>
</html>
