/* Header Improvements */
.header {
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 0.625rem 0.875rem;
    gap: 0.625rem;
    max-width: 100%;
}

.header-left {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.back-button {
    opacity: 0.95;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
    font-weight: 500;
    grid-column: 1;
    justify-self: start;
    font-size: 0.85rem;
}

.back-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-2px);
}

.back-button:active {
    transform: translateX(0);
}

.back-button i {
    font-size: 0.85rem;
}

.header-title {
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    min-width: 0;
    letter-spacing: -0.02em;
    text-align: center;
    grid-column: 2;
    justify-self: center;
    margin: 0;
    font-size: 1.15rem;
}

.header-user-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    flex-shrink: 0;
    width: 100%;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    color: white;
}

.header-action-btn {
    opacity: 0.95;
    padding: 0.5rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
    color: white;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-action-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-action-btn:active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .header-content {
        padding: 0.625rem 1rem;
        flex-direction: row;
        align-items: center;
    }
    
    .header-left {
        flex: 1;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    .header-user-container {
        width: auto;
        max-width: 280px;
        padding: 0.35rem 0.5rem;
    }
    
    .header-user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .header-action-btn {
        min-width: 34px;
        min-height: 34px;
        padding: 0.45rem;
    }
}

@media (max-width: 767px) {
    .header-content {
        padding: 0.625rem 0.875rem;
        flex-direction: column;
        gap: 0.625rem;
    }
    
    .header-left {
        width: 100%;
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }
    
    .header-title {
        font-size: 1.1rem;
        grid-column: 1 / -1;
        text-align: center;
        line-height: 1.3;
    }
    
    .back-button {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .back-button span {
        display: none;
    }
    
    .header-user-container {
        width: 100%;
        padding: 0.4rem 0.5rem;
        gap: 0.5rem;
    }
    
    .header-user-info {
        gap: 0.5rem;
    }
    
    .header-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .user-name {
        font-size: 0.8rem;
        flex: 1;
    }
    
    .header-action-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem;
    }
}
