{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}New Style{% endblock %}</title>
    
    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@700;800&display=swap" rel="stylesheet">
    
    <!-- Bootstrap 5 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
    
    <style>
        :root {
            --bg-color: #050505;
            --surface: #121212;
            --surface-accent: #1a1a1a;
            --border: #252525;
            --text: #ffffff;
            --text-muted: #888888;
            --accent: #00ff88; /* Vibrant green accent */
        }

        body {
            background-color: var(--bg-color);
            color: var(--text);
            font-family: 'Inter', sans-serif;
            margin: 0;
            padding: 0;
            min-height: 100vh;
            overflow-x: hidden;
        }

        .main-app {
            max-width: 450px; /* Mobile focused width */
            margin: 0 auto;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding: 0 15px;
            position: relative;
        }

        /* Top Bar */
        .header-bar {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            align-items: center;
            padding: 20px 0;
        }

        .header-left {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 10px;
        }

        .header-center {
            text-align: center;
            font-size: 1.5rem;
            font-weight: 800;
            font-family: 'Montserrat', sans-serif;
        }

        .header-right {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 10px;
        }

        .avatar-circle {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: var(--surface-accent);
            border: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            color: var(--text-muted);
            text-decoration: none;
        }
        .avatar-circle:hover {
            color: var(--accent);
            border-color: var(--accent);
        }

        /* Category Nav */
        .category-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0;
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            margin-bottom: 20px;
        }

        .category-nav a {
            color: var(--text);
            text-decoration: none;
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: color 0.2s;
        }

        .category-nav a:hover, .category-nav a.active {
            color: var(--accent);
        }

        .nav-divider {
            width: 1px;
            height: 15px;
            background-color: var(--border);
        }

        /* Forms & Buttons */
        .btn-custom {
            background: var(--surface-accent);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 10px 20px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 0.8rem;
            transition: all 0.2s;
            text-decoration: none;
            display: inline-block;
            text-align: center;
        }

        .btn-custom:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        
        .btn-accent {
            background: var(--accent);
            color: #000;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            font-weight: 700;
            font-size: 0.8rem;
            text-decoration: none;
            display: inline-block;
            transition: opacity 0.2s;
        }
        .btn-accent:hover {
            opacity: 0.9;
            color: #000;
        }

        .line-separator {
            width: 100%;
            height: 1px;
            background-color: var(--border);
            margin-bottom: 20px;
        }
        
        /* Modal Customization */
        .modal-content {
            background-color: var(--surface);
            border: 1px solid var(--border);
            color: var(--text);
        }
        .modal-header {
            border-bottom: 1px solid var(--border);
        }
        .modal-footer {
            border-top: 1px solid var(--border);
        }
        .form-control, .form-select {
            background-color: var(--bg-color);
            border: 1px solid var(--border);
            color: var(--text);
        }
        .form-control:focus, .form-select:focus {
            background-color: var(--bg-color);
            border-color: var(--accent);
            color: var(--text);
            box-shadow: none;
        }
        
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-muted);
        }
        .empty-state i {
            font-size: 3rem;
            margin-bottom: 15px;
            display: block;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <div class="main-app">
        <header class="header-bar">
            <div class="header-left">
                {% if user.is_authenticated %}
                    <span class="season-icon">
                        <i class="bi bi-person-fill text-muted"></i>
                        <span style="font-size: 0.7rem; margin-left: 5px;">{{ user.username }}</span>
                    </span>
                {% endif %}
            </div>
            <div class="header-center">
                <a href="{% url 'home' %}" style="text-decoration: none; color: inherit;">NEW STYLE</a>
            </div>
            <div class="header-right">
                {% if user.is_authenticated %}
                    <form action="{% url 'logout' %}" method="post" style="display:inline;">
                        {% csrf_token %}
                        <button type="submit" class="avatar-circle" style="background:none; border:none; cursor:pointer;">
                            <i class="bi bi-box-arrow-right"></i>
                        </button>
                    </form>
                {% else %}
                    <a href="{% url 'login' %}" class="avatar-circle">
                        <i class="bi bi-person"></i>
                    </a>
                {% endif %}
            </div>
        </header>

        {% if user.is_authenticated %}
        <nav class="category-nav">
            <a href="{% url 'wardrobe' %}" class="{% if request.resolver_match.url_name == 'wardrobe' %}active{% endif %}">Wardrobe</a>
            <div class="nav-divider"></div>
            <a href="{% url 'accessories' %}" class="{% if request.resolver_match.url_name == 'accessories' %}active{% endif %}">Accessories</a>
            <div class="nav-divider"></div>
            <a href="{% url 'new_fit' %}" class="{% if request.resolver_match.url_name == 'new_fit' %}active{% endif %}">New Fit</a>
            <div class="nav-divider"></div>
            <a href="{% url 'outfits' %}" class="{% if request.resolver_match.url_name == 'outfits' %}active{% endif %}">Outfits</a>
        </nav>
        {% endif %}

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

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