<script lang="ts">
    export let currentPage: "matches" | "settings" | "qualifiers" | "teams" | "mappools" = "matches";
    export let tournamentName;
    export let tournamnentGuid;
</script>

<div class="side-menu">
    <div class="menu-items">
        <a href="/tournaments/{tournamnentGuid}" class="menu-item {currentPage === 'matches' ? 'active' : ''}">
            <span class="menu-icon material-icons">sports_esports</span>
            <span class="menu-text">Matches</span>
            <div class="hover-indicator"></div>
        </a>
        
        <a href="/tournaments/{tournamnentGuid}/settings" class="menu-item {currentPage === 'settings' ? 'active' : ''}">
            <span class="menu-icon material-icons">settings</span>
            <span class="menu-text">Settings</span>
            <div class="hover-indicator"></div>
        </a>
        
        <a href="/tournaments/{tournamnentGuid}/qualifiers" class="menu-item {currentPage === 'qualifiers' ? 'active' : ''}">
            <span class="menu-icon material-icons">filter_list</span>
            <span class="menu-text">Qualifiers</span>
            <div class="hover-indicator"></div>
        </a>
        
        <a href="/tournaments/{tournamnentGuid}/teams" class="menu-item {currentPage === 'teams' ? 'active' : ''}">
            <span class="menu-icon material-icons">groups</span>
            <span class="menu-text">Teams</span>
            <div class="hover-indicator"></div>
        </a>
        
        <a href="/tournaments/{tournamnentGuid}/mappools" class="menu-item {currentPage === 'mappools' ? 'active' : ''}">
            <span class="menu-icon material-icons">format_list_bulleted</span>
            <span class="menu-text">Map Pools</span>
            <div class="hover-indicator"></div>
        </a>
    </div>
    
    <div class="menu-footer">
        <div class="tournament-info">
            <h3>Current Tournament</h3>
            <p>{tournamentName || "No Name"}</p>
        </div>
    </div>
</div>

<style>
    .side-menu {
        width: 240px;
        border-right: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
    }
    
    .menu-items {
        display: flex;
        flex-direction: column;
        padding: 1.5rem 0;
    }
    
    .menu-item {
        display: flex;
        align-items: center;
        padding: 0.75rem 1.5rem;
        color: var(--text-secondary);
        text-decoration: none;
        position: relative;
        transition: color 0.2s ease;
        transition: margin-left 0.2s ease;
    }
    
    .menu-item:hover {
        color: var(--text-primary);
        margin-left: 0.2rem;
    }
    
    .menu-item.active {
        color: var(--text-primary);
    }
    
    .menu-icon {
        margin-right: 0.75rem;
    }
    
    .menu-text {
        font-weight: 500;
    }
    
    .menu-item .hover-indicator {
        position: absolute;
        left: 0;
        top: 0;
        width: 3px;
        height: 0;
        background: linear-gradient(180deg, transparent, var(--accent-color), transparent);
        transition: height 0.3s ease;
        opacity: 0;
    }
    
    .menu-item:hover .hover-indicator {
        height: 100%;
        opacity: 1;
        box-shadow: 0 0 8px var(--accent-glow);
    }
    
    .menu-item.active .hover-indicator {
        height: 100%;
        opacity: 1;
        box-shadow: 0 0 12px var(--accent-glow);
        background: linear-gradient(180deg, transparent, var(--accent-hover), transparent);
    }
    
    .menu-footer {
        padding: 1.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    .tournament-info h3 {
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-secondary);
        margin-bottom: 0.5rem;
    }
    
    .tournament-info p {
        font-weight: 600;
        color: var(--text-primary);
    }
</style>