{% load static %}
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Автошкола{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
    <link rel="manifest" href="{% static 'manifest.json' %}">
    <meta name="theme-color" content="#000000">
    <style>
        .main-background {
            background-image: url('{% static "images/temnaa-masina-na-sosse-vecernee-vozdenie-letnii-peizaz.jpg" %}');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            min-height: 100vh;
            position: relative;
        }
        .main-background::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
        }
        .main-content {
            position: relative;
            z-index: 1;
            color: white;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark" style="background-color: rgba(0, 0, 0, 0.8);">
        <div class="container">
            <a class="navbar-brand" href="{% url 'accounts:home' %}">
                <i class="fas fa-car me-2"></i>Флагман
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'course:list' %}">
                            <i class="fas fa-book me-2"></i>Курсы
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'instructor:list' %}">
                            <i class="fas fa-user-tie me-2"></i>Инструкторы
                        </a>
                    </li>
                    {% if user.is_authenticated %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'schedule:list' %}">
                            <i class="fas fa-calendar-alt me-2"></i>Расписание
                        </a>
                    </li>
                    {% endif %}
                </ul>
                <ul class="navbar-nav">
                    {% if user.is_authenticated %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'accounts:profile' %}">
                                <i class="fas fa-user me-2"></i>{{ user.get_full_name }}
                            </a>
                        </li>
                        <li class="nav-item">
                            <form action="{% url 'accounts:logout' %}" method="post" style="display: inline;">
                                {% csrf_token %}
                                <button type="submit" class="nav-link btn btn-link" style="color: rgba(255,255,255,.55); text-decoration: none; padding: 0.5rem 1rem;">
                                    <i class="fas fa-sign-out-alt me-2"></i>Выход
                                </button>
                            </form>
                        </li>
                    {% else %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'accounts:login' %}">
                                <i class="fas fa-sign-in-alt me-2"></i>Вход
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'accounts:register' %}">
                                <i class="fas fa-user-plus me-2"></i>Регистрация
                            </a>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <main class="main-background">
        <div class="container main-content py-4">
            {% if messages %}
                {% for message in messages %}
                    <div class="alert alert-{{ message.tags }} alert-dismissible fade show">
                        {{ message }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                    </div>
                {% endfor %}
            {% endif %}

            {% block content %}{% endblock %}
        </div>
    </main>

    <footer class="bg-light py-4 mt-5">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <h5>Автошкола</h5>
                    <p>Профессиональное обучение вождению с опытными инструкторами</p>
                </div>
                <div class="col-md-3">
                    <h5>Контакты</h5>
                    <p>
                        <i class="fas fa-phone me-2"></i>+7 (999) 123-45-67<br>
                        <i class="fas fa-envelope me-2"></i>info@autoschool.ru
                    </p>
                </div>
                <div class="col-md-3">
                    <h5>Мы в соцсетях</h5>
                    <div class="social-links">
                        <a href="#" class="text-dark me-2"><i class="fab fa-vk fa-2x"></i></a>
                        <a href="#" class="text-dark me-2"><i class="fab fa-telegram fa-2x"></i></a>
                        <a href="#" class="text-dark"><i class="fab fa-whatsapp fa-2x"></i></a>
                    </div>
                </div>
            </div>
            <hr>
            <div class="text-center">
                <p class="mb-0">&copy; 2025 Автошкола. Все права защищены.</p>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    {% block extra_js %}{% endblock %}
</body>
</html> 