<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            background-color: #2C3E50;
            color: white;
            padding: 20px;
            text-align: center;
        }
        .content {
            background-color: #f9f9f9;
            padding: 30px;
            margin-top: 20px;
        }
        .section {
            background-color: white;
            padding: 20px;
            margin: 15px 0;
            border-left: 4px solid #3498db;
        }
        .section h3 {
            margin-top: 0;
            color: #2C3E50;
        }
        .info-row {
            margin: 10px 0;
        }
        .label {
            font-weight: bold;
            color: #555;
        }
        .cover-letter {
            background-color: #f0f0f0;
            padding: 15px;
            border-radius: 5px;
            white-space: pre-wrap;
            margin-top: 10px;
        }
        .links a {
            display: inline-block;
            margin: 5px 10px 5px 0;
            color: #3498db;
            text-decoration: none;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #ddd;
            font-size: 12px;
            color: #666;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🎯 New Job Application</h1>
            <p>{{ job_title }}</p>
        </div>
        
        <div class="content">
            <div class="section">
                <h3>👤 Applicant Information</h3>
                <div class="info-row">
                    <span class="label">Name:</span> {{ applicant_name }}
                </div>
                <div class="info-row">
                    <span class="label">Email:</span> <a href="mailto:{{ applicant_email }}">{{ applicant_email }}</a>
                </div>
                {% if applicant_phone %}
                <div class="info-row">
                    <span class="label">Phone:</span> {{ applicant_phone }}
                </div>
                {% endif %}
            </div>
            
            <div class="section">
                <h3>💼 Professional Information</h3>
                {% if current_position %}
                <div class="info-row">
                    <span class="label">Current Position:</span> {{ current_position }}
                </div>
                {% endif %}
                {% if current_company %}
                <div class="info-row">
                    <span class="label">Current Company:</span> {{ current_company }}
                </div>
                {% endif %}
                {% if years_of_experience %}
                <div class="info-row">
                    <span class="label">Years of Experience:</span> {{ years_of_experience }}
                </div>
                {% endif %}
            </div>
            
            <div class="section">
                <h3>📋 Application Details</h3>
                <div class="info-row">
                    <span class="label">Position Applied:</span> {{ job_title }}
                </div>
                <div class="info-row">
                    <span class="label">Application Date:</span> {{ application_date|date:"F d, Y at h:i A" }}
                </div>
                {% if expected_salary %}
                <div class="info-row">
                    <span class="label">Expected Salary:</span> {{ expected_salary }} {{ salary_currency }}
                </div>
                {% endif %}
                {% if available_from %}
                <div class="info-row">
                    <span class="label">Available From:</span> {{ available_from|date:"F d, Y" }}
                </div>
                {% endif %}
                {% if notice_period %}
                <div class="info-row">
                    <span class="label">Notice Period:</span> {{ notice_period }}
                </div>
                {% endif %}
            </div>
            
            {% if portfolio_url or linkedin_url or github_url or website_url %}
            <div class="section">
                <h3>🔗 Links</h3>
                <div class="links">
                    {% if portfolio_url %}<a href="{{ portfolio_url }}" target="_blank">📁 Portfolio</a>{% endif %}
                    {% if linkedin_url %}<a href="{{ linkedin_url }}" target="_blank">💼 LinkedIn</a>{% endif %}
                    {% if github_url %}<a href="{{ github_url }}" target="_blank">💻 GitHub</a>{% endif %}
                    {% if website_url %}<a href="{{ website_url }}" target="_blank">🌐 Website</a>{% endif %}
                </div>
            </div>
            {% endif %}
            
            {% if cover_letter %}
            <div class="section">
                <h3>✉️ Cover Letter</h3>
                <div class="cover-letter">{{ cover_letter }}</div>
            </div>
            {% endif %}
        </div>
        
        <div class="footer">
            <p><strong>Resume is attached to this email.</strong></p>
            <p>Please log in to the admin panel to review the full application and update its status.</p>
        </div>
    </div>
</body>
</html>

